mirror of
https://github.com/git/git
synced 2024-10-02 14:45:21 +00:00
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 <dsymonds@gmail.com> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9e79f00f06
commit
726c8ef5a5
|
@ -183,7 +183,13 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
|
||||||
const void *needle, size_t needlelen);
|
const void *needle, size_t needlelen);
|
||||||
#endif
|
#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
|
#define strchrnul gitstrchrnul
|
||||||
static inline char *gitstrchrnul(const char *s, int c)
|
static inline char *gitstrchrnul(const char *s, int c)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue