From: Viktor Szakats Date: Fri, 11 Nov 2022 20:12:15 +0000 (+0000) Subject: config-win32: fix SIZEOF_OFF_T for MSVC and old MinGW X-Git-Tag: curl-7_87_0~173 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83c4c1a056ddee1fe3161a783d685b72ed7eebd2;p=thirdparty%2Fcurl.git config-win32: fix SIZEOF_OFF_T for MSVC and old MinGW The previously set default value of 8 (64-bit) is only correct for mingw-w64 and only when we set `_FILE_OFFSET_BITS` to 64 (the default when building curl). For MSVC, old MinGW and other Windows compilers, the correct value is 4 (32-bit). Adjust condition accordingly. Also drop the manual override option. Regression in 7.86.0 (from 68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6) Bug: https://github.com/curl/curl/pull/9712#issuecomment-1307330551 Reported-by: Peter Piekarski Reviewed-by: Jay Satiro Closes #9872 --- diff --git a/lib/config-win32.h b/lib/config-win32.h index 2837380227..fb10f7e945 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -331,11 +331,6 @@ /* Define to the size of `curl_off_t', as computed by sizeof. */ #define SIZEOF_CURL_OFF_T 8 -/* Define to the size of `off_t', as computed by sizeof. */ -#ifndef SIZEOF_OFF_T -#define SIZEOF_OFF_T 8 -#endif - /* ---------------------------------------------------------------- */ /* BSD-style lwIP TCP/IP stack SPECIFIC */ /* ---------------------------------------------------------------- */ @@ -577,6 +572,14 @@ Vista # endif #endif +/* Define to the size of `off_t', as computed by sizeof. */ +#if defined(__MINGW64_VERSION_MAJOR) && \ + defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +# define SIZEOF_OFF_T 8 +#else +# define SIZEOF_OFF_T 4 +#endif + /* ---------------------------------------------------------------- */ /* DNS RESOLVER SPECIALTY */ /* ---------------------------------------------------------------- */