summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-22 10:26:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-22 10:26:38 -0700
commite4bae5f23e2c12d2771b93adc7c686d8f600b3a9 (patch)
treebc322de95b5a1ae1dfe233b95789f0a2a2cb7d16
parentca8e535970c7bec44e02141113e31a42bb0a1c5e (diff)
Assume target platforms have strcasecmp nowHEADmaster
It has been required since Unix98/SUSv2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbevd/-/merge_requests/5>
-rw-r--r--configure.ac2
-rw-r--r--utils.c29
-rw-r--r--utils.h5
3 files changed, 1 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac
index cf90f71..3758b62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,6 @@ if test ! -f "cfgparse.c"; then
fi
fi
-AC_CHECK_FUNCS([strcasecmp])
-
# Checks for pkg-config packages
PKG_CHECK_MODULES(XKBEVD, xkbfile x11)
diff --git a/utils.c b/utils.c
index 9446852..c3e5148 100644
--- a/utils.c
+++ b/utils.c
@@ -125,32 +125,3 @@ uInternalError(const char *s, ...)
/***====================================================================***/
-#ifndef HAVE_STRCASECMP
-int
-uStrCaseCmp(const char *str1, const char *str2)
-{
- char buf1[512], buf2[512];
-
- char c, *s;
-
- register int n;
-
- for (n = 0, s = buf1; (c = *str1++); n++) {
- if (isupper(c))
- c = tolower(c);
- if (n > 510)
- break;
- *s++ = c;
- }
- *s = '\0';
- for (n = 0, s = buf2; (c = *str2++); n++) {
- if (isupper(c))
- c = tolower(c);
- if (n > 510)
- break;
- *s++ = c;
- }
- *s = '\0';
- return (strcmp(buf1, buf2));
-}
-#endif
diff --git a/utils.h b/utils.h
index 53ef0b2..bf477fc 100644
--- a/utils.h
+++ b/utils.h
@@ -39,6 +39,7 @@
#include <X11/Xfuncs.h>
#include <stdarg.h>
#include <stddef.h>
+#include <strings.h>
_XFUNCPROTOBEGIN
@@ -94,11 +95,7 @@ extern void uInternalError(const char *s, ...) _X_ATTRIBUTE_PRINTF(1, 2);
#define uStringPrefix(p,s) (strncmp(p,s,strlen(p))==0)
#define uStringCompare(s1,s2) (strcmp(s1,s2))
#define uStrCaseEqual(s1,s2) (uStrCaseCmp(s1,s2)==0)
-#ifdef HAVE_STRCASECMP
#define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2))
-#else
-extern int uStrCaseCmp(const char *s1, const char *s2);
-#endif
#define uStringDup(s1) (strdup(s1))
/***====================================================================***/