summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 16:03:11 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 16:03:11 -0700
commit0b4873ce55e3afe2e1716ef4a21cd94a7ae96e64 (patch)
treeb2b3c1eef0028a03e34dbde691c84ddbc00990b9 /utils.h
parente26102f28f08e5432b1ad44bbaef7f32aff199f6 (diff)
Assume target platforms have strcasecmp, strncasecmp, & strdup now
All have been required since Unix98/SUSv2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/merge_requests/23>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/utils.h b/utils.h
index 2bf7674..a3b83b0 100644
--- a/utils.h
+++ b/utils.h
@@ -134,6 +134,9 @@ uInformation(const char * /* s */ , ...
/***====================================================================***/
+#include <strings.h>
+#include <string.h>
+
#define NullString ((char *)NULL)
#define uStringText(s) ((s)==NullString?"<NullString>":(s))
@@ -142,25 +145,9 @@ uInformation(const char * /* s */ , ...
#define uStringCompare(s1,s2) (((s1)==NullString||(s2)==NullString)?\
(s1)!=(s2):strcmp(s1,s2))
#define uStrCaseEqual(s1,s2) (uStrCaseCmp(s1,s2)==0)
-#ifdef HAVE_STRCASECMP
-#include <strings.h>
#define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2))
#define uStrCasePrefix(p,s) (strncasecmp(p,s,strlen(p))==0)
-#else
- extern int uStrCaseCmp(const char * /* s1 */ ,
- const char * /* s2 */
- );
- extern int uStrCasePrefix(const char * /* p */ ,
- char * /* str */
- );
-#endif
-#ifdef HAVE_STRDUP
-#include <string.h>
#define uStringDup(s1) ((s1) ? strdup(s1) : NULL)
-#else
- extern char *uStringDup(const char * /* s1 */
- );
-#endif
/***====================================================================***/