From 7b3d71b7189b4f81da812e144d6db9e0ab7cf531 Mon Sep 17 00:00:00 2001 From: Milton Woods Date: Sun, 5 Sep 2021 17:13:23 +1000 Subject: [PATCH] Define strcasecmp for Windows in ncconfigure.h --- include/ncconfigure.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/include/ncconfigure.h b/include/ncconfigure.h index 2b4375ea5..a12e4ab50 100644 --- a/include/ncconfigure.h +++ b/include/ncconfigure.h @@ -65,13 +65,28 @@ extern int fileno(FILE*); #endif #endif /*STDC*/ -#endif /*!_WIN32*/ -#ifdef _WIN32 +#else /*_WIN32*/ + #ifndef HAVE_STRLCAT #define strlcat(d,s,n) strcat_s((d),(n),(s)) #endif + +#ifndef __MINGW32__ +#ifndef strcasecmp +#define strcasecmp _stricmp #endif +#ifndef strncasecmp +#define strncasecmp _strnicmp +#endif +#ifndef snprintf +#if _MSC_VER<1900 +#define snprintf _snprintf +#endif +#endif +#endif /*__MINGW32__*/ + +#endif /*_WIN32*/ /* handle null arguments */ #ifndef nulldup