]> git.cworth.org Git - notmuch/commitdiff
compat: probe for strcasestr more thoroughly
authorMichael J Gruber <git@grubix.eu>
Sat, 26 Aug 2023 14:53:12 +0000 (16:53 +0200)
committerDavid Bremner <david@tethera.net>
Sun, 27 Aug 2023 22:39:23 +0000 (19:39 -0300)
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>
compat/have_strcasestr.c

index 3cd1838d950bd30c6239053a09d2a8f401f8b537..8e004572dbf04865f538ba8d051b1745ae2fd495 100644 (file)
@@ -1,5 +1,6 @@
 #define _GNU_SOURCE
-#include <strings.h>
+#include <strings.h> /* strcasecmp() in POSIX */
+#include <string.h> /* strcasecmp() in *BSD */
 
 int
 main ()