notmuch/compat/have_strcasestr.c
Michael J Gruber a84dc2f7e6 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>
2023-08-27 19:39:23 -03:00

12 lines
229 B
C

#define _GNU_SOURCE
#include <strings.h> /* strcasecmp() in POSIX */
#include <string.h> /* strcasecmp() in *BSD */
int
main ()
{
char *found;
const char *haystack, *needle;
found = strcasestr (haystack, needle);
}