From bb9e9503f46ac7c10de38c8cb5201fd253108f00 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 25 Apr 2018 23:42:36 +0000 Subject: Recognize _XOPEN_SOURCE 500 as another way of requesting strcasecmp git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3207 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/util/nstring.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/util') 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) { -- cgit 1.4.1