From 3f15062a8afd23e32adebb54ebc92fee05011645 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 29 May 2011 14:57:40 +0200 Subject: [PATCH] argp: Allow coexistence with strerror_r-posix module. * lib/argp-help.c (__argp_failure): If strerror_r is defined as a macro (either to __xpg_strerror_r by glibc's or to rpl_strerror_r by gnulib's replacement), assume it has the POSIX signature, not the glibc signature. --- ChangeLog | 8 ++++++++ lib/argp-help.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eb0f674d68..77274bb51c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-05-29 Bruno Haible + + argp: Allow coexistence with strerror_r-posix module. + * lib/argp-help.c (__argp_failure): If strerror_r is defined as a macro + (either to __xpg_strerror_r by glibc's or to rpl_strerror_r + by gnulib's replacement), assume it has the POSIX signature, + not the glibc signature. + 2011-05-28 Bruno Haible gnulib-tool: Alternative structure of testdirs, similar to --import. diff --git a/lib/argp-help.c b/lib/argp-help.c index 7993794718..0cc5838583 100644 --- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -1917,7 +1917,7 @@ __argp_failure (const struct argp_state *state, int status, int errnum, char const *s = NULL; putc_unlocked (':', stream); putc_unlocked (' ', stream); -#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P) +#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P && !defined strerror_r) s = __strerror_r (errnum, buf, sizeof buf); #elif HAVE_DECL_STRERROR_R if (__strerror_r (errnum, buf, sizeof buf) == 0) -- 2.30.2