aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-12-10 20:21:40 +0100
committerAndreas Schneider <asn@cryptomilk.org>2016-11-05 16:41:50 +0100
commitb62b822100011e8dc1ab79ed41f3222910e40c31 (patch)
tree2884b5a65ccf773d52d2628311f9d6b56c6ba979
parent849f5db5d1cfe582a17eedcc8a64347367f716c5 (diff)
downloadlibssh-b62b822100011e8dc1ab79ed41f3222910e40c31.tar.gz
libssh-b62b822100011e8dc1ab79ed41f3222910e40c31.tar.xz
libssh-b62b822100011e8dc1ab79ed41f3222910e40c31.zip
cmake: Correctly check for *snprintf functions on Windows
BUG: https://red.libssh.org/issues/205 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 1bf6c965e491e1851c8102dafa4a87c4deb085d9)
-rw-r--r--ConfigureChecks.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 7d306872..6de33801 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -112,16 +112,19 @@ endif (NOT WITH_GCRYPT)
check_function_exists(isblank HAVE_ISBLANK)
check_function_exists(strncpy HAVE_STRNCPY)
-check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
-check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
+if (NOT WIN32)
+ check_function_exists(vsnprintf HAVE_VSNPRINTF)
+ check_function_exists(snprintf HAVE_SNPRINTF)
+endif (NOT WIN32)
if (WIN32)
- check_function_exists(_strtoui64 HAVE__STRTOUI64)
+ check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
+ check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
- check_function_exists(_vsnprintf_s HAVE__VSNPRINTF_S)
- check_function_exists(_vsnprintf HAVE__VSNPRINTF)
- check_function_exists(_snprintf HAVE__SNPRINTF)
- check_function_exists(_snprintf_s HAVE__SNPRINTF_S)
+ check_symbol_exists(_vsnprintf_s "stdio.h" HAVE__VSNPRINTF_S)
+ check_symbol_exists(_vsnprintf "stdio.h" HAVE__VSNPRINTF)
+ check_symbol_exists(_snprintf "stdio.h" HAVE__SNPRINTF)
+ check_symbol_exists(_snprintf_s "stdio.h" HAVE__SNPRINTF_S)
if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
check_symbol_exists(ntohll winsock2.h HAVE_NTOHLL)
@@ -135,6 +138,8 @@ if (WIN32)
set(CMAKE_REQUIRED_LIBRARIES)
endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
+ check_function_exists(_strtoui64 HAVE__STRTOUI64)
+
set(HAVE_SELECT TRUE)
else (WIN32)
check_function_exists(poll HAVE_POLL)