src/string.c

changeset 1693
c2d05cf1a062
parent 1685
0344372c7115
equal deleted inserted replaced
1692:56731bb98508 1693:c2d05cf1a062
39 #include <limits.h> 39 #include <limits.h>
40 #include <float.h> 40 #include <float.h>
41 #include <ctype.h> 41 #include <ctype.h>
42 42
43 #ifdef _WIN32 43 #ifdef _WIN32
44 #define cx_strcasecmp_impl _strnicmp 44 static int cx_fixed_strnicmp(const char* s1, const char* s2, size_t count) {
45 // Microsoft's implementation crashes when count == 0 and either string is NULL
46 if (count == 0) return 0;
47 return _strnicmp(s1, s2, count);
48 }
49 #define cx_strcasecmp_impl cx_fixed_strnicmp
45 #else 50 #else
46 #include <strings.h> 51 #include <strings.h>
47 #define cx_strcasecmp_impl strncasecmp 52 #define cx_strcasecmp_impl strncasecmp
48 #endif 53 #endif
49 54

mercurial