From: Johannes Sixt <j6t@kdbg.org>
To: Nick Alcock <nix@esperi.org.uk>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH na/strtoimax] Compatibility: declare strtoimax() under NO_STRTOUMAX
Date: Sat, 05 Nov 2011 17:34:27 +0100 [thread overview]
Message-ID: <4EB56593.6090402@kdbg.org> (raw)
In-Reply-To: <4EB5583E.2030306@kdbg.org>
Am 05.11.2011 16:37, schrieb Johannes Sixt:
> Commit f696543d (Add strtoimax() compatibility function) introduced an
> implementation of the function, but forgot to add a declaration.
On second thought, I'm puzzled: Without this patch and without noticing
the warning that strtoimax() was not declared, I had built with
NO_STRTOUMAX on MinGW before, and the build succeeded. This means that
even though MinGW's headers are not C99, we must have pulled in function
strtoimax() from somewhere. I'll investigate later this weekend.
Anyway, this patch does not just add a declaration for the function, but
also redirects strtoimax to gitstrtoimax, which is a bit more than the
commit message claims. Without this patch, topic na/strtoimax should not
build on a non-C99 environment. Can you verify this claim?
-- Hannes
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> git-compat-util.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/git-compat-util.h b/git-compat-util.h
> index feb6f8e..4efef46 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -354,6 +354,8 @@ extern size_t gitstrlcpy(char *, const char *, size_t);
> #ifdef NO_STRTOUMAX
> #define strtoumax gitstrtoumax
> extern uintmax_t gitstrtoumax(const char *, char **, int);
> +#define strtoimax gitstrtoimax
> +extern intmax_t gitstrtoimax(const char *, char **, int);
> #endif
>
> #ifdef NO_STRTOK_R
next prev parent reply other threads:[~2011-11-05 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-05 15:37 [PATCH na/strtoimax] Compatibility: declare strtoimax() under NO_STRTOUMAX Johannes Sixt
2011-11-05 15:38 ` Nix
2011-11-05 16:34 ` Johannes Sixt [this message]
2011-11-06 18:21 ` Ramsay Jones
2011-11-06 6:10 ` Junio C Hamano
2011-11-06 8:53 ` Johannes Sixt
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=4EB56593.6090402@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nix@esperi.org.uk \
/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).