]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix stdint/inttypes detection with non-autotools
authorViktor Szakats <commit@vsz.me>
Mon, 13 Mar 2023 10:46:38 +0000 (10:46 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 13 Mar 2023 10:47:21 +0000 (10:47 +0000)
Fix `stdint.h` and `inttypes.h` detection with non-autotools builds on
Windows. (autotools already auto-detected them accurately.)

`lib/config-win32.h` builds (e.g. `Makefile.mk`):
- set `HAVE_STDINT_H` where supported.
- set `HAVE_INTTYPES_H` for MinGW.

CMake:
- auto-detect them on Windows. (They were both force-disabled.)
- delete unused `CURL_PULL_STDINT_H`.
- delete unused `CURL_PULL_INTTYPES_H`.
- stop detecting `HAVE_STDINT_H` twice.
  Present since the initial CMake commit: 4c5307b45655ba75ab066564afdc0c111a8b9291

curl doesn't use these C99 headers, we need them now to workaround
broken wolfSSL builds. Ref: #10739

Once that clears up, we can delete these detections and macros (unless
we want to keep them for future us.)

Reviewed-by: Daniel Stenberg
Closes #10745

CMake/Platforms/WindowsCache.cmake
CMakeLists.txt
lib/config-win32.h

index cef31b55fa9bd74a9ff3d88fe1610855df8fb550..37712377e4cfdd185c42147bf324bec3d931b329 100644 (file)
@@ -29,7 +29,6 @@ if(NOT UNIX)
 
     set(HAVE_ARPA_INET_H 0)
     set(HAVE_FCNTL_H 1)
-    set(HAVE_INTTYPES_H 0)
     set(HAVE_IO_H 1)
     set(HAVE_NETDB_H 0)
     set(HAVE_NETINET_IN_H 0)
@@ -37,7 +36,6 @@ if(NOT UNIX)
     set(HAVE_PWD_H 0)
     set(HAVE_SETJMP_H 1)
     set(HAVE_SIGNAL_H 1)
-    set(HAVE_STDINT_H 0)
     set(HAVE_STDLIB_H 1)
     set(HAVE_STRINGS_H 0)
     set(HAVE_STRING_H 1)
index 74361998c43be8468bfa6fc7cd1a3895a5cca7c0..318fad916e02bb44aeacd978fd5396f0363dc21a 100644 (file)
@@ -989,7 +989,6 @@ check_include_file_concat("unistd.h"         HAVE_UNISTD_H)
 check_include_file_concat("utime.h"          HAVE_UTIME_H)
 
 check_include_file_concat("stddef.h"         HAVE_STDDEF_H)
-check_include_file_concat("stdint.h"        HAVE_STDINT_H)
 check_include_file_concat("sys/utsname.h"   HAVE_SYS_UTSNAME_H)
 
 check_type_size(size_t  SIZEOF_SIZE_T)
@@ -1263,8 +1262,6 @@ else()
   set(CURL_PULL_SYS_SOCKET_H ${HAVE_SYS_SOCKET_H})
   set(CURL_PULL_SYS_POLL_H ${HAVE_SYS_POLL_H})
 endif()
-set(CURL_PULL_STDINT_H ${HAVE_STDINT_H})
-set(CURL_PULL_INTTYPES_H ${HAVE_INTTYPES_H})
 
 include(CMake/OtherTests.cmake)
 
index 68c063aa09fca46fc339a0abab6d75c066e1df8e..0879e232ab66d5761091c030c0dff3e4f4d0176c 100644 (file)
 #define HAVE_FCNTL_H 1
 
 /* Define to 1 if you have the <inttypes.h> header file. */
-#if defined(_MSC_VER) && (_MSC_VER >= 1800)
+#if defined(__MINGW32__) || \
+    (defined(_MSC_VER) && (_MSC_VER >= 1800))
 #define HAVE_INTTYPES_H 1
 #endif
 
+/* Define to 1 if you have the <stdint.h> header file. */
+#if defined(__MINGW32__) || defined(__POCC__) || \
+    (defined(_MSC_VER) && (_MSC_VER >= 1600)) || \
+    (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0582))
+#define HAVE_STDINT_H 1
+#endif
+
 /* Define if you have the <io.h> header file. */
 #define HAVE_IO_H 1