[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] strerror_r-posix: Fix override of AC_FUNC_STRERROR_R
From: |
Bruno Haible |
Subject: |
Re: [PATCH] strerror_r-posix: Fix override of AC_FUNC_STRERROR_R |
Date: |
Fri, 04 Nov 2016 23:50:48 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
Hi Eric,
Thanks for noticing and fixing this faster than I could.
> A better approach is to replace the autoconf macro with a version
> of our own that doesn't probe anything, so that the AC_DEFINE is
> reached exactly once.
Yes, agreed.
> +AC_DEFUN([AC_FUNC_STRERROR_R], [
> + AC_DEFINE([HAVE_DECL_STRERROR_R], [1],
> + [Define to 1, since you should have the declaration of strerror_r.])
> + AC_DEFINE([STRERROR_R_CHAR_P], [0],
> + [Define to 0, since strerror_r should not return char *.])
> ])
In this definition I would also add
AC_DEFINE([HAVE_STRERROR_R], [1],
[Define to 1, since you should have the function strerror_r.])
Rationale: The autoconf documentation says that AC_FUNC_STRERROR_R
defines HAVE_STRERROR_R too. The user's configure.ac may possibly
- invoke or AC_REQUIRE AC_FUNC_STRERROR_R,
- then rely on the value of HAVE_STRERROR_R,
- then only invoke gl_INIT.
Bruno