diff options
-rw-r--r-- | lib/util/nstring.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/util/nstring.h b/lib/util/nstring.h index bded8417..9801ca17 100644 --- a/lib/util/nstring.h +++ b/lib/util/nstring.h @@ -64,11 +64,17 @@ memeq(const void * const comparand, return memcmp(comparand, comparator, size) == 0; } -/* The Standard C Library may not declare strcasecmp() if the including - source file doesn't request BSD functions, with _BSD_SOURCE. So - we don't define functions that use strcasecmp() in that case. +/* The Standard C Library may not declare strcasecmp() if the including source + file doesn't request BSD functions, with _BSD_SOURCE or SUSv2 function, + with _XOPEN_SOURCE >= 500. So we don't define functions that use + strcasecmp() in that case. + + (Actually, _XOPEN_SOURCE 500 is stronger than you need for strcasecmp - + _XOPEN_SOURCE_EXTENDED, which asks for XPG 4 would do, whereas + _XOPEN_SOURCE 500 asks for XPG 5, but for simplicity, we don't use + _XOPEN_SOURCE_EXTENDED in Netpbm. */ -#ifdef _BSD_SOURCE +#if defined(_BSD_SOURCE) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) >= 500) static __inline__ int strcaseeq(const char * const comparand, const char * const comparator) { |