In effect it meant `_WIN32 && !USE_WIN32_LARGE_FILES`.
Replace it with these macros.
Also:
- configure: delete tautological check for small file support.
- configure: delete stray `_MSC_VER` reference. autotools does not
support MSVC.
- drop tautological checks for WinCE in `config-win32*.h` when setting
`USE_WIN32_LARGE_FILES`.
- merge related PP logic.
- prefer `#ifdef`, fix whitespace.
Suggested-by: Marcel Raad
Report: https://github.com/curl/curl/pull/15952#issuecomment-
2580092328
Closes #15968
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
]],[[
- #if !defined(_WIN32_WCE) && (defined(__MINGW32__) || defined(_MSC_VER))
+ #if !defined(_WIN32_WCE) && defined(__MINGW32__)
int dummy=1;
#else
#error Win32 large file API not supported.
])
fi
if test "$curl_win32_file_api" = "no"; then
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
- ]],[[
- #if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER)
- int dummy=1;
- #else
- #error Win32 small file API not supported.
- #endif
- ]])
- ],[
- curl_win32_file_api="win32_small_files"
- ])
+ curl_win32_file_api="win32_small_files"
fi
fi
case "$curl_win32_file_api" in
;;
win32_small_files)
AC_MSG_RESULT([yes (large file disabled)])
- AC_DEFINE_UNQUOTED(USE_WIN32_SMALL_FILES, 1,
- [Define to 1 if you are building a Windows target without large file support.])
;;
*)
AC_MSG_RESULT([no])
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER) || defined(__MINGW32__)
# define USE_WIN32_LARGE_FILES
-#endif
-
-#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
-# define USE_WIN32_LARGE_FILES
-#endif
-
-#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
-# define USE_WIN32_SMALL_FILES
-#endif
-
/* Number of bits in a file offset, on hosts where this is settable. */
-#if defined(USE_WIN32_LARGE_FILES) && defined(__MINGW32__)
-# ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
+# ifdef __MINGW32__
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+# endif
# endif
#endif
/* LARGE FILE SUPPORT */
/* ---------------------------------------------------------------- */
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
-# define USE_WIN32_LARGE_FILES
-#endif
-
-#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
-# define USE_WIN32_SMALL_FILES
-#endif
+/* Windows CE does not support large files */
/* ---------------------------------------------------------------- */
/* LDAP SUPPORT */
#include "curl_setup.h"
-#if defined(_WIN32)
+#ifdef _WIN32
#include "curl_multibyte.h"
return str_utf8;
}
-#endif /* _WIN32 */
-
-#if defined(USE_WIN32_LARGE_FILES) || defined(USE_WIN32_SMALL_FILES)
-
/* declare GetFullPathNameW for mingw-w64 UWP builds targeting old windows */
#if defined(CURL_WINDOWS_UWP) && defined(__MINGW32__) && \
(_WIN32_WINNT < _WIN32_WINNT_WIN10)
target = fixed;
else
target = path_w;
-#if defined(USE_WIN32_SMALL_FILES)
+#ifndef USE_WIN32_LARGE_FILES
result = _wstat(target, buffer);
#else
result = _wstati64(target, buffer);
target = fixed;
else
target = path;
-#if defined(USE_WIN32_SMALL_FILES)
+#ifndef USE_WIN32_LARGE_FILES
result = _stat(target, buffer);
#else
result = _stati64(target, buffer);
return result;
}
-#endif /* USE_WIN32_LARGE_FILES || USE_WIN32_SMALL_FILES */
+#endif /* _WIN32 */
* Small file (<2Gb) support using Win32 functions.
*/
-#ifdef USE_WIN32_SMALL_FILES
+#if defined(_WIN32) && !defined(USE_WIN32_LARGE_FILES)
# include <io.h>
# include <sys/types.h>
# include <sys/stat.h>
{
struct per_transfer *per = userdata;
-#if(SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES)
+#if (SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES)
/* The offset check following here is only interesting if curl_off_t is
larger than off_t and we are not using the Win32 large file support