summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J Gruber <git@grubix.eu>2023-08-26 16:53:12 +0200
committerDavid Bremner <david@tethera.net>2023-08-27 19:39:23 -0300
commita84dc2f7e64e70bd9696efe933671b2cbdfcd329 (patch)
tree938cdcc51b3aacef0d4819feacf4d31c73c773d3
parent9a1126241d6c4a12610b5de61044606352ca4712 (diff)
compat: probe for strcasestr more thoroughly
Depending on compiler (gcc, g++, clang) and standard options (c99, c11), string.h may or may not include strings.h, leading to possibly missing or conflicting declarations of strcasestr. Include both so that both detection and compilation phases use the same (possibly optimised) implementations. Suggested-by: Thomas Schneider <qsx@chaotikum.eu> Suggested-by: Florian Weimer <fweimer@redhat.com> Suggested-by: Tomi Ollila <tomi.ollila@iki.fi>
-rw-r--r--compat/have_strcasestr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/have_strcasestr.c b/compat/have_strcasestr.c
index 3cd1838d..8e004572 100644
--- a/compat/have_strcasestr.c
+++ b/compat/have_strcasestr.c
@@ -1,5 +1,6 @@
#define _GNU_SOURCE
-#include <strings.h>
+#include <strings.h> /* strcasecmp() in POSIX */
+#include <string.h> /* strcasecmp() in *BSD */
int
main ()