File tree 2 files changed +11
-18
lines changed
2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 116
116
don't. */
117
117
#define HAVE_DECL_PWRITEV 1
118
118
119
+ /* Define to 1 if you have the declaration of `strchrnul', and to 0 if you
120
+ don't. */
121
+ #undef HAVE_DECL_STRCHRNUL
122
+
119
123
/* Define to 1 if you have the declaration of `strlcat', and to 0 if you
120
124
don't. */
121
125
#define HAVE_DECL_STRLCAT 1
397
401
/* Define to 1 if you have the <stdlib.h> header file. */
398
402
#define HAVE_STDLIB_H 1
399
403
400
- /* Define to 1 if you have the `strchrnul' function. */
401
- /* #undef HAVE_STRCHRNUL */
402
-
403
404
/* Define to 1 if you have the `strerror_r' function. */
404
405
#define HAVE_STRERROR_R 1
405
406
851
852
/* Ensure we do not fail on systems that have strchrnul support (FreeBSD, NetBSD and newer glibc) */
852
853
#include <stdlib.h>
853
854
#if defined(__FreeBSD__ ) || defined(__NetBSD__ ) || (defined(__GLIBC__ ) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38 ) || __GLIBC__ > 2 ))
854
- #define HAVE_STRCHRNUL
855
+ #define HAVE_DECL_STRCHRNUL 1
856
+ #else
857
+ #define HAVE_DECL_STRCHRNUL 0
855
858
#endif
856
859
857
860
/* 32-bit */
Original file line number Diff line number Diff line change @@ -368,7 +368,9 @@ static void trailing_pad(int padlen, PrintfTarget *target);
368
368
* Note: glibc declares this as returning "char *", but that would require
369
369
* casting away const internally, so we don't follow that detail.
370
370
*/
371
- #ifndef HAVE_STRCHRNUL
371
+ #if !HAVE_DECL_STRCHRNUL
372
+
373
+ #define strchrnul pg_strchrnul
372
374
373
375
static inline const char *
374
376
strchrnul (const char * s , int c )
@@ -378,19 +380,7 @@ strchrnul(const char *s, int c)
378
380
return s ;
379
381
}
380
382
381
- #else
382
-
383
- /*
384
- * glibc's <string.h> declares strchrnul only if _GNU_SOURCE is defined.
385
- * While we typically use that on glibc platforms, configure will set
386
- * HAVE_STRCHRNUL whether it's used or not. Fill in the missing declaration
387
- * so that this file will compile cleanly with or without _GNU_SOURCE.
388
- */
389
- #ifndef _GNU_SOURCE
390
- extern char * strchrnul (const char * s , int c );
391
- #endif
392
-
393
- #endif /* HAVE_STRCHRNUL */
383
+ #endif /* !HAVE_DECL_STRCHRNUL */
394
384
395
385
396
386
/*
You can’t perform that action at this time.
0 commit comments