We don't want to call the normal fseeko/ftello wrappers in libmingwex in this case.
Signed-off-by: Martin Storsjö <mar...@martin.st> --- mingw-w64-headers/crt/stdio.h | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index 830bba3..fcad9e2 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -669,11 +669,35 @@ int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_li int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos); int __cdecl fsetpos64(FILE *_File,const fpos_t *_Pos); /* fsetpos already 64bit */ int __cdecl fseek(FILE *_File,long _Offset,int _Origin); + long __cdecl ftell(FILE *_File); /* Shouldn't be any fseeko32 in glibc, 32bit to 64bit casting should be fine */ /* int fseeko32(FILE* stream, _off_t offset, int whence);*/ /* fseeko32 redirects to fseeko64 */ +#if __MSVCRT_VERSION__ >= 0x1400 + // Mark these as _CRTIMP to avoid trying to link in the mingwex versions. + _CRTIMP int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin); + _CRTIMP __int64 __cdecl _ftelli64(FILE *_File); + __mingw_static_ovr int fseeko(FILE *_File, _off_t _Offset, int _Origin) { + return fseek(_File, _Offset, _Origin); + } + __mingw_static_ovr int fseeko64(FILE *_File, _off64_t _Offset, int _Origin) { + return _fseeki64(_File, _Offset, _Origin); + } + __mingw_static_ovr _off_t ftello(FILE *_File) { + return ftell(_File); + } + __mingw_static_ovr _off64_t ftello64(FILE *_File) { + return _ftelli64(_File); + } +#else + __MINGW_EXTENSION int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin); + __MINGW_EXTENSION __int64 __cdecl _ftelli64(FILE *_File); int fseeko64(FILE* stream, _off64_t offset, int whence); int fseeko(FILE* stream, _off_t offset, int whence); + /* Returns truncated 64bit off_t */ + _off_t ftello(FILE * stream); + _off64_t ftello64(FILE * stream); +#endif #ifndef _FILE_OFFSET_BITS_SET_FSEEKO #define _FILE_OFFSET_BITS_SET_FSEEKO @@ -682,11 +706,6 @@ int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_li #endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */ #endif /* _FILE_OFFSET_BITS_SET_FSEEKO */ - long __cdecl ftell(FILE *_File); - /* Returns truncated 64bit off_t */ - _off_t ftello(FILE * stream); - _off64_t ftello64(FILE * stream); - #ifndef _FILE_OFFSET_BITS_SET_FTELLO #define _FILE_OFFSET_BITS_SET_FTELLO #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) @@ -694,8 +713,6 @@ int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_li #endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */ #endif /* _FILE_OFFSET_BITS_SET_FTELLO */ - __MINGW_EXTENSION int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin); - __MINGW_EXTENSION __int64 __cdecl _ftelli64(FILE *_File); size_t __cdecl fwrite(const void * __restrict__ _Str,size_t _Size,size_t _Count,FILE * __restrict__ _File); int __cdecl getc(FILE *_File); int __cdecl getchar(void); -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public