diff options
author | João Valverde <j@v6e.pt> | 2021-09-22 04:26:21 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2021-09-22 14:37:13 +0100 |
commit | 6921f01250c8722fb925943f41f4647a1cbd02f1 (patch) | |
tree | 183f7b927e72f986be83b995d0bb6954e94dba18 /ConfigureChecks.cmake | |
parent | 8d59f81729f967a2e0fd17b6860655ddd921a63a (diff) |
MinGW-w64: Need to use ANSI C stdio
Defining _POSIX enables __USE_MINGW_ANSI_STDIO, this switches the
stdio API from Microsoft to MinGW internal (ANSI C).
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 328292e699..f81abeb258 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -107,6 +107,10 @@ check_symbol_exists(tzname "time.h" HAVE_TZNAME) # Check if the libc vsnprintf() conforms to C99. If this fails we may # need to fall-back on GLib I/O. # +cmake_push_check_state(RESET) +if(MINGW) + set(CMAKE_REQUIRED_DEFINITIONS -D__USE_MINGW_ANSI_STDIO) +endif() check_c_source_runs(" #include <stdio.h> int main(void) @@ -120,6 +124,7 @@ check_c_source_runs(" }" HAVE_C99_VSNPRINTF ) +cmake_pop_check_state() if (NOT HAVE_C99_VSNPRINTF) message(FATAL_ERROR "Building Wireshark requires a C99 compliant vsnprintf() and this \ |