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:39:37 +0100
commit1bf6c965e491e1851c8102dafa4a87c4deb085d9 (patch)
treee6e7ab0626cf104c85f5621ed1ddd18185bc8378
parentfa2332354b54fed9fa5dc5b566c6f1777f2d701e (diff)
downloadlibssh-1bf6c965e491e1851c8102dafa4a87c4deb085d9.tar.gz
libssh-1bf6c965e491e1851c8102dafa4a87c4deb085d9.tar.xz
libssh-1bf6c965e491e1851c8102dafa4a87c4deb085d9.zip
cmake: Correctly check for *snprintf functions on Windows
BUG: https://red.libssh.org/issues/205 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--ConfigureChecks.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 1917ce21..22d98e25 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -125,16 +125,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)
@@ -148,6 +151,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)