aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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 18f9a365..0520e240 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,6 +108,16 @@ IF(NOT "${HAVE_STRCASECMP}")
ADD_DEFINITIONS(-Dstrcasecmp=_stricmp)
ENDIF()
+CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
+IF(NOT "${HAVE_STRNCASECMP}")
+ CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
+ IF(NOT "${HAVE__STRNICMP}")
+ MESSAGE(FATAL_ERROR "No case-insensitive size-limitted compare function found, please report!")
+ ENDIF()
+
+ ADD_DEFINITIONS(-Dstrncasecmp=_strnicmp)
+ENDIF()
+
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
IF(NOT "${HAVE_SNPRINTF}")
CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)