summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-01-29 00:57:02 -0800
committerGuy Harris <guy@alum.mit.edu>2018-01-29 00:57:02 -0800
commit494c8096e0881e4f82440bc7b0b41b6969cd92b9 (patch)
treec50d94da03abc21411da49690a1e4e0d779b8fb5 /CMakeLists.txt
parentbe658698f958010d2eed8e9ae8a88ec81e844e74 (diff)
downloadtcpdump-494c8096e0881e4f82440bc7b0b41b6969cd92b9.tar.gz
Use check_symbol_exists for {v}snprintf().
With MSVC 2015, stdio.h defines snprintf() and vsnprintf() as inline functions, so you need to include stdio.h when testing for them - check_function_exists() won't do it, you need check_symbol_exists().
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c34d21bc..5cc87ded 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,8 +203,13 @@ endif(STDLIBS_HAVE_GETSERVENT)
cmake_pop_check_state()
check_function_exists(getopt_long HAVE_GETOPT_LONG)
-check_function_exists(vsnprintf HAVE_VSNPRINTF)
-check_function_exists(snprintf HAVE_SNPRINTF)
+#
+# With MSVC 2015, stdio.h defines snprintf() and vsnprintf() as inline
+# functions, so you need to include stdio.h when testing for them -
+# check_function_exists() won't do it, you need check_symbol_exists().
+#
+check_symbol_exists(vsnprintf stdio.h HAVE_VSNPRINTF)
+check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF)
check_function_exists(fork HAVE_FORK)
check_function_exists(vfork HAVE_VFORK)
check_function_exists(strftime HAVE_STRFTIME)