On Mon, 26 Nov 2018, Jacek Caban wrote:
Hi Mateusz,
The patch looks mostly good to me.
On 23/11/2018 22:37, Mateusz wrote:
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -609,31 +609,20 @@ int vsnprintf (char *__stream, size_t __n, const char
*__format, __builtin_va_li
/* 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
+#if __MSVCRT_VERSION__ >= 0x900
// 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);
+#endif
I would suggest to get rid of #if here and simply always use _CRTIMP without
__MINGW_EXTENSION. This would require adding symbols with __MINGW_IMP_SYMBOL
to symbols in fseeki64.c.
I'm not quite sure I know all the nuances about the difference between
e.g. fseeko64 and _fseeki64 (looking at stdio/fseeko64.c, their
implementation is rather different), but... On one hand I'd like to keep
inline versions in the headers for ucrt, but on the other hand it is
unnecessary if the libmingwex versions work as well. If others prefer
unifying it I don't mind.
In general the patch (the latest version) looks rather straightforward to
me, and I'm fine with it if Jacek is.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public