src: add CURL_STRICMP() macro, use _stricmp() on Windows

Add `CURL_STRICMP()` macro that works on all platforms depending on
which lib C function is available.

Make sure to always use `_stricmp()` on Windows, which is the
non-deprecated, official API for this on this platform. Before this
patch it used a MinGW-specific call, or a deprecated compatibility
wrapper with MSVC.

Drop `stricmp` variant detections on Windows with autotools.

https://learn.microsoft.com/cpp/c-runtime-library/reference/stricmp-wcsicmp-mbsicmp-stricmp-l-wcsicmp-l-mbsicmp-l

Ref: #15652
Closes #15788
This commit is contained in:
Viktor Szakats 2024-11-27 12:34:38 +01:00
parent 68bd759c2b
commit 6dacd2f208
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
7 changed files with 28 additions and 37 deletions

View file

@ -158,17 +158,9 @@
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
/* Define if you have the strcasecmp function. */
#if defined(__MINGW32__)
#define HAVE_STRCASECMP 1
#endif
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Define if you have the strtoll function. */
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__)
#define HAVE_STRTOLL 1

View file

@ -114,15 +114,9 @@
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
/* Define if you have the strcasecmp function. */
/* #define HAVE_STRCASECMP 1 */
/* Define if you have the strdup function. */
/* #define HAVE_STRDUP 1 */
/* Define if you have the stricmp function. */
/* #define HAVE_STRICMP 1 */
/* Define if you have the strtoll function. */
#if defined(__MINGW32__)
#define HAVE_STRTOLL 1