Re: [PATCH 6/7] Check if strtoumax is a macro (eg HP-UX 11.11).
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 18, 2020, 17:17 UTC
- Message-ID
- <xmqqo8ql40z7.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200518100356.29292-6-dtucker@dtucker.net>
Darren Tucker <dtucker@dtucker.net> writes:
Show 25 quoted lines
> Signed-off-by: Darren Tucker <dtucker@dtucker.net> > --- > configure.ac | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 14e09b04b6..87a39c5ae0 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1164,10 +1164,16 @@ GIT_CHECK_FUNC(strtoull, > [NO_STRTOULL=YesPlease]) > GIT_CONF_SUBST([NO_STRTOULL]) > # > -# Define NO_STRTOUMAX if you don't have strtoumax in the C library. > +# Define NO_STRTOUMAX if you don't have strtoumax in the C library > +# or as a macro in inttypes.h. > GIT_CHECK_FUNC(strtoumax, > [NO_STRTOUMAX=], > -[NO_STRTOUMAX=YesPlease]) > +[ > + AC_CHECK_DECL(strtoumax, > + [NO_STRTOUMAX=], > + [NO_STRTOUMAX=YesPlease], > + [#include <inttypes.h>]) > +])
It is kind of surprising that we got away with GIT_CHECK_FUNC() that misses an implementation by macro without having problems with other symbols.
I don't mind taking this patch as-is, but it makes me wonder if we need to devise a more systematic approach to the issue than "oh, I found GIT_CHECK_FUNC() does not work for X on system Y, so let's add an AC_CHECK_DECL() for it, too" approach, which this patch is its first step.
Thanks.