1
mirror of https://github.com/mpv-player/mpv synced 2025-01-13 00:06:25 +01:00

Remove unused fseeko() check and fallback implementation.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23797 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2007-07-17 09:40:32 +00:00
parent 411a4b4058
commit e9b8b6cf1a
3 changed files with 0 additions and 93 deletions

25
configure vendored
View File

@ -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

View File

@ -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

View File

@ -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;
}