From: Johannes Sixt Date: Mon, 12 Nov 2007 10:09:05 +0000 (+0100) Subject: Fix preprocessor logic that determines the availablity of strchrnul(). X-Git-Tag: v1.5.4-rc0~213^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=726c8ef5a5a129d8157d0043f60fe7195d2cdb77;p=git.git Fix preprocessor logic that determines the availablity of strchrnul(). Apart from the error in the condition (&& should actually be ||), the construct #if !defined(A) || !A leads to a syntax error in the C preprocessor if A is indeed not defined. Tested-by: David Symonds Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff --git a/git-compat-util.h b/git-compat-util.h index 92d79673f..ede9408bb 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -183,7 +183,13 @@ void *gitmemmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); #endif -#if !defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 1) +#ifdef __GLIBC_PREREQ +#if __GLIBC_PREREQ(2, 1) +#define HAVE_STRCHRNUL +#endif +#endif + +#ifndef HAVE_STRCHRNUL #define strchrnul gitstrchrnul static inline char *gitstrchrnul(const char *s, int c) {