From 7db81061d745e47e6aae1b947c7a5b40084529de Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 10 Jan 2007 19:35:41 +0000 Subject: 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 --- osdep/Makefile | 3 ++- osdep/fseeko.c | 19 +------------------ osdep/ftello.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 osdep/ftello.c (limited to 'osdep') diff --git a/osdep/Makefile b/osdep/Makefile index 9865581623..d1fee0ef78 100644 --- a/osdep/Makefile +++ b/osdep/Makefile @@ -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 diff --git a/osdep/fseeko.c b/osdep/fseeko.c index decbaf5c8f..7d942a1c25 100644 --- a/osdep/fseeko.c +++ b/osdep/fseeko.c @@ -4,13 +4,11 @@ */ #include "config.h" - -#if !defined(HAVE_FSEEKO) || !defined(HAVE_FTELLO) + #include #include #include #include -#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 diff --git a/osdep/ftello.c b/osdep/ftello.c new file mode 100644 index 0000000000..d11710b89f --- /dev/null +++ b/osdep/ftello.c @@ -0,0 +1,19 @@ +/* + * ftello.c + * 64-bit version of ftello() for systems which do not have it + */ + +#include "config.h" + +#include +#include + +off_t +ftello(FILE *stream) +{ + fpos_t floc; + + if (fgetpos(stream, &floc) != 0) + return -1; + return floc; +} -- cgit v1.2.3