From 8949ef3cf68bb5038cfffefcb2fed0c2c30180d8 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 4 Apr 2017 02:13:10 +1000 Subject: windows doesn't have strings.h for strcasecmp, however it does have _stricmp --- src/openssl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/openssl.c') diff --git a/src/openssl.c b/src/openssl.c index 5c47635..b9aaeb2 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -30,7 +30,6 @@ #include /* INT_MAX INT_MIN LLONG_MAX LLONG_MIN UCHAR_MAX ULLONG_MAX */ #include /* uintptr_t */ #include /* memset(3) strerror_r(3) */ -#include /* strcasecmp(3) */ #include /* INFINITY fabs(3) floor(3) frexp(3) fmod(3) round(3) isfinite(3) */ #include /* struct tm time_t strptime(3) time(2) */ #include /* isdigit(3), isxdigit(3), tolower(3) */ @@ -493,7 +492,12 @@ #undef MIN #define MIN(a, b) (((a) < (b))? (a) : (b)) +#ifdef _WIN32 +#define stricmp(a, b) _stricmp((a), (b)) +#else +#include /* strcasecmp(3) */ #define stricmp(a, b) strcasecmp((a), (b)) +#endif #define strieq(a, b) (!stricmp((a), (b))) #define xtolower(c) tolower((unsigned char)(c)) @@ -988,7 +992,13 @@ NOTUSED static auxtype_t auxL_getref(lua_State *L, auxref_t ref) { static int auxL_testoption(lua_State *L, int index, const char *def, const char *const *optlist, _Bool nocase) { const char *optname = (def)? luaL_optstring(L, index, def) : luaL_checkstring(L, index); - int (*optcmp)() = (nocase)? &strcasecmp : &strcmp; + int (*optcmp)() = (nocase)? +#ifdef _WIN32 + &_stricmp +#else + &strcasecmp +#endif + : &strcmp; int i; for (i = 0; optlist[i]; i++) { -- cgit v1.2.3-59-g8ed1b