From: Jeff King <peff@peff.net>
To: Bernd Kuhls <bernd.kuhls@writeme.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] configure.ac: fix old iconv check
Date: Mon, 16 Jan 2017 16:41:11 -0500 [thread overview]
Message-ID: <20170116214111.v2imkedzyofcpt6b@sigill.intra.peff.net> (raw)
In-Reply-To: <20170116195638.3713-1-bernd.kuhls@writeme.com>
On Mon, Jan 16, 2017 at 08:56:37PM +0100, Bernd Kuhls wrote:
> According to
> https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Running-the-Compiler.html
> the parameter syntax of AC_COMPILE_IFELSE is
>
> (input, [action-if-true], [action-if-false])
>
> Displaying "no" when the test was positive and enabling support for old
> iconv implementations by OLD_ICONV=UnfortunatelyYes when the test fails
> it obviously wrong. This patch switches the actions to fix the problem.
Hrm. But the test code is:
# Define OLD_ICONV if your library has an old iconv(), where the second
# (input buffer pointer) parameter is declared with type (const char **).
AC_DEFUN([OLDICONVTEST_SRC], [
AC_LANG_PROGRAM([[
#include <iconv.h>
extern size_t iconv(iconv_t cd,
char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft);
]], [])])
Which will compile correctly for the _new_ code, but not the old. So
when the test is positive, then "no", we do not need to set the
OLD_ICONV flag.
The logic would probably be clearer if the test were reversed. It would
mean that other compilation problems (e.g., you do not have iconv.h at
all) would fail to see OLD_ICONV, but that seems reasonable.
-Peff
prev parent reply other threads:[~2017-01-16 21:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 19:56 [PATCH 1/2] configure.ac: fix old iconv check Bernd Kuhls
2017-01-16 19:56 ` [PATCH 2/2] configure.ac: Fix --without-iconv Bernd Kuhls
2017-01-16 21:41 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170116214111.v2imkedzyofcpt6b@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bernd.kuhls@writeme.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).