mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:33:46 +01:00
Split fseeko.c into fseeko.c and ftello.c, move #ifdefs into the build system.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21874 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b2c4df0543
commit
7db81061d7
6
configure
vendored
6
configure
vendored
@ -3439,8 +3439,10 @@ _fseeko=no
|
||||
cc_check && _fseeko=yes
|
||||
if test "$_fseeko" = yes ; then
|
||||
_def_fseeko='#define HAVE_FSEEKO 1'
|
||||
_need_fseeko=no
|
||||
else
|
||||
_def_fseeko='#undef HAVE_FSEEKO'
|
||||
_need_fseeko=yes
|
||||
fi
|
||||
echores "$_fseeko"
|
||||
|
||||
@ -7234,8 +7236,10 @@ _ftello=no
|
||||
cc_check && _ftello=yes
|
||||
if test "$_ftello" = yes ; then
|
||||
_def_ftello='#define HAVE_FTELLO 1'
|
||||
_need_ftello=no
|
||||
else
|
||||
_def_ftello='#undef HAVE_FTELLO'
|
||||
_need_ftello=yes
|
||||
fi
|
||||
echores "$_ftello"
|
||||
|
||||
@ -7479,6 +7483,8 @@ HAVE_XVMC_ACCEL = $_xvmc
|
||||
|
||||
HAVE_SYS_MMAN_H = _mman
|
||||
|
||||
NEED_FSEEKO = $_need_fseeko
|
||||
NEED_FTELLO = $_need_ftello
|
||||
NEED_GLOB = $_need_glob
|
||||
NEED_SCANDIR = $_need_scandir
|
||||
NEED_SETENV = $_need_setenv
|
||||
|
@ -4,7 +4,6 @@ include ../config.mak
|
||||
LIBNAME = libosdep.a
|
||||
|
||||
SRCS= strl.c \
|
||||
fseeko.c \
|
||||
|
||||
SRCS-$(HAVE_SYS_MMAN_H) += mmap_anon.c
|
||||
SRCS-$(MACOSX_FINDER_SUPPORT) += macosx_finder_args.c
|
||||
@ -12,6 +11,8 @@ ifneq ($(TARGET_OS),MINGW32)
|
||||
SRCS-$(STREAM_CACHE) += shmem.c
|
||||
endif
|
||||
|
||||
SRCS-$(NEED_FSEEKO) += fseeko.c
|
||||
SRCS-$(NEED_FTELLO) += ftello.c
|
||||
SRCS-$(NEED_GETTIMEOFDAY) += gettimeofday.c
|
||||
SRCS-$(NEED_SCANDIR) += scandir.c
|
||||
SRCS-$(NEED_SETENV) += setenv.c
|
||||
|
@ -4,13 +4,11 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if !defined(HAVE_FSEEKO) || !defined(HAVE_FTELLO)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define flockfile
|
||||
@ -25,7 +23,6 @@
|
||||
* This is thread-safe on BSD/OS using flockfile/funlockfile.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_FSEEKO
|
||||
int
|
||||
fseeko(FILE *stream, off_t offset, int whence)
|
||||
{
|
||||
@ -68,17 +65,3 @@ failure:
|
||||
funlockfile(stream);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_FTELLO
|
||||
off_t
|
||||
ftello(FILE *stream)
|
||||
{
|
||||
fpos_t floc;
|
||||
|
||||
if (fgetpos(stream, &floc) != 0)
|
||||
return -1;
|
||||
return floc;
|
||||
}
|
||||
#endif
|
||||
|
19
osdep/ftello.c
Normal file
19
osdep/ftello.c
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* ftello.c
|
||||
* 64-bit version of ftello() for systems which do not have it
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
off_t
|
||||
ftello(FILE *stream)
|
||||
{
|
||||
fpos_t floc;
|
||||
|
||||
if (fgetpos(stream, &floc) != 0)
|
||||
return -1;
|
||||
return floc;
|
||||
}
|
Loading…
Reference in New Issue
Block a user