summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-22 13:35:52 -0800
committerChris Robinson <[email protected]>2007-12-22 13:35:52 -0800
commit51c5fa94aa9592d2c25209b94b6cbe4349850cbd (patch)
tree9b2816ccbcf8c31ef01b88d2fac508409ef516aa /CMakeLists.txt
parent5b0514a829afcdca201096f8f1c38ab684d45b49 (diff)
Check for snprintf, and use _snprintf when needed
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0dea95a6..ea296b72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,16 @@ IF(NOT "${HAVE_STRCASECMP}")
ADD_DEFINITIONS(-Dstrcasecmp=_stricmp)
ENDIF()
+CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
+IF(NOT "${HAVE_SNPRINTF}")
+ CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
+ IF(NOT "${HAVE__SNPRINTF}")
+ MESSAGE(FATAL_ERROR "No snprintf function found, please report!")
+ ENDIF()
+
+ ADD_DEFINITIONS(-Dsnprintf=_snprintf)
+ENDIF()
+
# Check for the dlopen API (for dynamicly loading backend libs)
IF(DLOPEN)
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)