diff --git a/include/meson.build b/include/meson.build index 484c5579c..650b86e6d 100644 --- a/include/meson.build +++ b/include/meson.build @@ -169,11 +169,9 @@ conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction') ? '1' : false) conf_data.set('HAVE_SIGPROCMASK', cc.has_function('sigprocmask') ? '1' : false) # HAVE_SOCKLEN_T is used by xtrans when IPv6 is disabled conf_data.set('HAVE_SOCKLEN_T', cc.has_type('socklen_t', prefix: '#include ') ? '1' : false) -conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp') ? '1' : false) conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr') ? '1' : false) conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: libbsd_dep) ? '1' : false) conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy', dependencies: libbsd_dep) ? '1' : false) -conf_data.set('HAVE_STRNCASECMP', cc.has_function('strncasecmp') ? '1' : false) conf_data.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup') ? '1' : false) # HAVE_STRUCT_SOCKADDR_STORAGE is used by xtrans >= 1.6 conf_data.set('HAVE_STRUCT_SOCKADDR_STORAGE', cc.has_type('struct sockaddr_storage', prefix: '#include ') ? '1' : false) diff --git a/include/os.h b/include/os.h index 04edf0882..7f74e588c 100644 --- a/include/os.h +++ b/include/os.h @@ -234,18 +234,6 @@ extern _X_EXPORT void * reallocarray(void *optr, size_t nmemb, size_t size); #endif -#ifndef HAVE_STRCASECMP -#define strcasecmp xstrcasecmp -extern _X_EXPORT int -xstrcasecmp(const char *s1, const char *s2); -#endif - -#ifndef HAVE_STRNCASECMP -#define strncasecmp xstrncasecmp -extern _X_EXPORT int -xstrncasecmp(const char *s1, const char *s2, size_t n); -#endif - #ifndef HAVE_STRCASESTR #define strcasestr xstrcasestr extern _X_EXPORT char * diff --git a/include/xorg-server.h.meson.in b/include/xorg-server.h.meson.in index 437162cd7..4c0a01c14 100644 --- a/include/xorg-server.h.meson.in +++ b/include/xorg-server.h.meson.in @@ -38,9 +38,6 @@ /* Define to 1 if you have the `reallocarray' function. */ #mesondefine HAVE_REALLOCARRAY -/* Define to 1 if you have the `strcasecmp' function. */ -#mesondefine HAVE_STRCASECMP - /* Define to 1 if you have the `strcasestr' function. */ #mesondefine HAVE_STRCASESTR @@ -50,9 +47,6 @@ /* Define to 1 if you have the `strlcpy' function. */ #mesondefine HAVE_STRLCPY -/* Define to 1 if you have the `strncasecmp' function. */ -#mesondefine HAVE_STRNCASECMP - /* Define to 1 if you have the `strndup' function. */ #mesondefine HAVE_STRNDUP diff --git a/os/meson.build b/os/meson.build index 8d5268f4d..9c8412d76 100644 --- a/os/meson.build +++ b/os/meson.build @@ -30,9 +30,6 @@ srcs_libc = [] if conf_data.get('HAVE_REALLOCARRAY').to_int() == 0 srcs_libc += 'reallocarray.c' endif -if conf_data.get('HAVE_STRCASECMP').to_int() == 0 - srcs_libc += 'strcasecmp.c' -endif if conf_data.get('HAVE_STRCASESTR').to_int() == 0 srcs_libc += 'strcasestr.c' endif diff --git a/os/strcasecmp.c b/os/strcasecmp.c index 50c2a3528..177a1467c 100644 --- a/os/strcasecmp.c +++ b/os/strcasecmp.c @@ -31,38 +31,3 @@ #include #include "dix.h" - -#ifndef HAVE_STRCASECMP -int -xstrcasecmp(const char *str1, const char *str2) -{ - const u_char *us1 = (const u_char *) str1, *us2 = (const u_char *) str2; - - while (tolower(*us1) == tolower(*us2)) { - if (*us1++ == '\0') - return 0; - us2++; - } - - return (tolower(*us1) - tolower(*us2)); -} -#endif - -#ifndef HAVE_STRNCASECMP -int -xstrncasecmp(const char *s1, const char *s2, size_t n) -{ - if (n != 0) { - const u_char *us1 = (const u_char *) s1, *us2 = (const u_char *) s2; - - do { - if (tolower(*us1) != tolower(*us2++)) - return (tolower(*us1) - tolower(*--us2)); - if (*us1++ == '\0') - break; - } while (--n != 0); - } - - return 0; -} -#endif