From cedea4d018e24db5675431b9023a1a26c791ac03 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 22 Feb 2023 17:14:09 +0100 Subject: [PATCH] configure: don't the check presence of stricmp _stricmp a Windows thing that is present in all the CRT, even in UCRT. The stricmp() deprecated variant doesn't seem to exist elsewhere. In some configuration it's not possible to link with stricmp() even though _stricmp() is available. --- compat/strcasecmp.c | 4 ++-- config.h.meson | 3 --- configure.ac | 2 +- meson.build | 1 - modules/audio_output/waveout.c | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/compat/strcasecmp.c b/compat/strcasecmp.c index 0a64bf1cee..092a2b0525 100644 --- a/compat/strcasecmp.c +++ b/compat/strcasecmp.c @@ -28,8 +28,8 @@ int strcasecmp (const char *s1, const char *s2) { -#ifdef HAVE_STRICMP - return stricmp (s1, s2); +#ifdef _WIN32 + return _stricmp (s1, s2); #else for (size_t i = 0;; i++) { diff --git a/config.h.meson b/config.h.meson index 8ad4394f9f..602fb0a84e 100644 --- a/config.h.meson +++ b/config.h.meson @@ -464,9 +464,6 @@ /* Define to 1 if you have the `strdup' function. */ #mesondefine HAVE_STRDUP -/* Define to 1 if you have the `stricmp' function. */ -#mesondefine HAVE_STRICMP - /* Define to 1 if you have the `strlcpy' function. */ #mesondefine HAVE_STRLCPY diff --git a/configure.ac b/configure.ac index c4e077eb88..514fdf917d 100644 --- a/configure.ac +++ b/configure.ac @@ -750,7 +750,7 @@ dnl Check for system libs needed need_libc=false dnl Check for usual libc functions -AC_CHECK_FUNCS([accept4 dup3 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 posix_fadvise setlocale stricmp uselocale wordexp]) +AC_CHECK_FUNCS([accept4 dup3 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 posix_fadvise setlocale uselocale wordexp]) AC_REPLACE_FUNCS([aligned_alloc asprintf atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lfind lldiv localtime_r memrchr nrand48 poll posix_memalign readv recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp vasprintf writev]) AC_REPLACE_FUNCS([gettimeofday]) AC_CHECK_FUNC(fdatasync,, diff --git a/meson.build b/meson.build index 9969a2c533..8bf97a2671 100644 --- a/meson.build +++ b/meson.build @@ -558,7 +558,6 @@ check_functions = [ ['open_memstream', '#include '], ['pipe2', '#include '], ['posix_fadvise', '#include '], - ['stricmp', '#include '], ['strcoll', '#include '], ['wordexp', '#include '], diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c index c6c0e6c80b..f5e132025a 100644 --- a/modules/audio_output/waveout.c +++ b/modules/audio_output/waveout.c @@ -753,7 +753,7 @@ static uint32_t findDeviceID(char *psz_device_name) _snwprintf( dev_name, MAXPNAMELEN + 32, device_name_fmt, caps.szPname, caps.wMid, caps.wPid ); char *u8 = FromWide(dev_name); - if( !stricmp(u8, psz_device_name) ) + if( !_stricmp(u8, psz_device_name) ) { free( u8 ); return i;