diff options
-rwxr-xr-x | configure | 25 | ||||
-rw-r--r-- | osdep/Makefile | 1 | ||||
-rw-r--r-- | osdep/fseeko.c | 67 |
3 files changed, 0 insertions, 93 deletions
@@ -3355,21 +3355,6 @@ else fi echores "$_strsep" -echocheck "fseeko()" -cat > $TMPC << EOF -#include <stdio.h> -int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; } -EOF -_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" echocheck "vsscanf()" cat > $TMPC << EOF @@ -7426,7 +7411,6 @@ HAVE_XVMC_ACCEL = $_xvmc HAVE_SYS_MMAN_H = $_mman HAVE_POSIX_SELECT = $_posix_select -NEED_FSEEKO = $_need_fseeko NEED_FTELLO = $_need_ftello NEED_GETTIMEOFDAY = $_need_gettimeofday NEED_GLOB = $_need_glob @@ -7799,15 +7783,6 @@ $_def_scandir /* Define this if your system has strsep */ $_def_strsep -/* Define this if your system has fseeko */ -$_def_fseeko -#ifndef HAVE_FSEEKO -/* Need these for FILE and off_t an config.h is usually before other includes*/ -#include <stdio.h> -#include <sys/types.h> -int fseeko(FILE *, off_t, int); -#endif - /* Define this if your system has vsscanf */ $_def_vsscanf diff --git a/osdep/Makefile b/osdep/Makefile index 8c520c3e10..34e360e7a7 100644 --- a/osdep/Makefile +++ b/osdep/Makefile @@ -5,7 +5,6 @@ LIBNAME_COMMON = libosdep.a SRCS_COMMON-$(HAVE_SYS_MMAN_H) += mmap_anon.c SRCS_COMMON-$(MACOSX_FINDER_SUPPORT) += macosx_finder_args.c -SRCS_COMMON-$(NEED_FSEEKO) += fseeko.c SRCS_COMMON-$(NEED_FTELLO) += ftello.c SRCS_COMMON-$(NEED_GETTIMEOFDAY) += gettimeofday.c SRCS_COMMON-$(NEED_GLOB) += glob-win.c diff --git a/osdep/fseeko.c b/osdep/fseeko.c deleted file mode 100644 index 7d942a1c25..0000000000 --- a/osdep/fseeko.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * fseeko.c - * 64-bit versions of fseeko/ftello() for systems which do not have them - */ - -#include "config.h" - -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <errno.h> - -#ifdef WIN32 -#define flockfile -#define funlockfile -#endif - -/* - * On BSD/OS and NetBSD (and perhaps others), off_t and fpos_t are the - * same. Standards say off_t is an arithmetic type, but not necessarily - * integral, while fpos_t might be neither. - * - * This is thread-safe on BSD/OS using flockfile/funlockfile. - */ - -int -fseeko(FILE *stream, off_t offset, int whence) -{ - fpos_t floc; - struct stat filestat; - - switch (whence) - { - case SEEK_CUR: - flockfile(stream); - if (fgetpos(stream, &floc) != 0) - goto failure; - floc += offset; - if (fsetpos(stream, &floc) != 0) - goto failure; - funlockfile(stream); - return 0; - break; - case SEEK_SET: - if (fsetpos(stream, &offset) != 0) - return -1; - return 0; - break; - case SEEK_END: - flockfile(stream); - if (fstat(fileno(stream), &filestat) != 0) - goto failure; - floc = filestat.st_size; - if (fsetpos(stream, &floc) != 0) - goto failure; - funlockfile(stream); - return 0; - break; - default: - errno = EINVAL; - return -1; - } - -failure: - funlockfile(stream); - return -1; -} |