Use __MINGW_ASM_CALL for function symbol redirect and use off_t type
(instead of _off_t) for return value. off_t type follows the
_FILE_OFFSET_BITS setting. _off_t type is always 32-bit.

Also remove _CRTIMP declaration because it is incompatible with
__MINGW_ASM_CALL macro for i386 builds with gcc. gcc automatically adds
additional underscore mangling to symbol name for function declared
together with _CRTIMP and __MINGW_ASM_CALL.
---
 mingw-w64-headers/crt/stdio.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index a45e49f69927..93c5db5d321a 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -589,15 +589,12 @@ int vsnprintf (char *__stream, size_t __n, const char 
*__format, __builtin_va_li
 #endif
   ;
   _CRTIMP int __cdecl fseeko64(FILE *_File, _off64_t _Offset, int _Origin);
-  _CRTIMP _off_t __cdecl ftello(FILE *_File);
-  _CRTIMP _off64_t __cdecl ftello64(FILE *_File);
-
-#ifndef _FILE_OFFSET_BITS_SET_FTELLO
-#define _FILE_OFFSET_BITS_SET_FTELLO
+  off_t __cdecl ftello(FILE *_File)
 #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
-#define ftello ftello64
-#endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */
-#endif /* _FILE_OFFSET_BITS_SET_FTELLO */
+  __MINGW_ASM_CALL(ftello64)
+#endif
+  ;
+  _CRTIMP _off64_t __cdecl ftello64(FILE *_File);
 
   size_t __cdecl fwrite(const void * __restrict__ _Str,size_t _Size,size_t 
_Count,FILE * __restrict__ _File);
   int __cdecl getc(FILE *_File);
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to