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

@ -36,7 +36,6 @@ if(MINGW)
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
set(HAVE_STRTOLL 1)
set(HAVE_BASENAME 1)
set(HAVE_STRCASECMP 1)
set(HAVE_FTRUNCATE 1)
set(HAVE_SYS_PARAM_H 1)
set(HAVE_SYS_TIME_H 1)
@ -47,7 +46,6 @@ if(MINGW)
set(HAVE_OPENDIR 1)
else()
set(HAVE_LIBGEN_H 0)
set(HAVE_STRCASECMP 0)
set(HAVE_FTRUNCATE 0)
set(HAVE_SYS_PARAM_H 0)
set(HAVE_SYS_TIME_H 0)
@ -149,8 +147,6 @@ set(HAVE_FSEEKO 0) # mingw-w64 2.0.0 and newer has it
set(HAVE_SOCKET 1)
set(HAVE_SELECT 1)
set(HAVE_STRDUP 1)
set(HAVE_STRICMP 1)
set(HAVE_STRCMPI 1)
set(HAVE_MEMRCHR 0)
set(HAVE_CLOSESOCKET 1)
set(HAVE_SIGSETJMP 0)