changeset 23777:28964958fb7b

Remove unused fseeko() check and fallback implementation.
author diego
date Tue, 17 Jul 2007 09:40:32 +0000
parents 703a889707df
children ba16c3a35250
files configure osdep/Makefile osdep/fseeko.c
diffstat 3 files changed, 0 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Tue Jul 17 09:35:21 2007 +0000
+++ b/configure	Tue Jul 17 09:40:32 2007 +0000
@@ -3355,21 +3355,6 @@
 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_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 @@
 /* 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
 
--- a/osdep/Makefile	Tue Jul 17 09:35:21 2007 +0000
+++ b/osdep/Makefile	Tue Jul 17 09:40:32 2007 +0000
@@ -5,7 +5,6 @@
 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
--- a/osdep/fseeko.c	Tue Jul 17 09:35:21 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-}