git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Symonds" <dsymonds@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Andreas Ericsson" <ae@op5.se>,
	"René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
	"Pierre Habouzit" <madcoder@debian.org>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Jakub Narebski" <jnareb@gmail.com>
Subject: Re: [PATCH] Simplify strchrnul() compat code
Date: Mon, 12 Nov 2007 20:03:33 +1100	[thread overview]
Message-ID: <ee77f5c20711120103s478e26cdib85f38293423d90c@mail.gmail.com> (raw)
In-Reply-To: <7v6409f4eh.fsf@gitster.siamese.dyndns.org>

On Nov 11, 2007 9:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Andreas Ericsson <ae@op5.se> writes:
>
> > René Scharfe wrote:
> >>  -#ifdef NO_STRCHRNUL
> >> +#if !defined(__GLIBC__) && !__GLIBC_PREREQ(2, 1)
> >
> > This will break things for users of glibc-2.1.1 (the first release still
> > available from ftp://sources.redhat.com/pub/glibc/old-releases that
> > includes the strchrnul() function), since __GLIBC_PREREQ() was invented
> > after strchrnul() was introduced.
> >
> > Replacing __GLIBC__ with __GLIBC_PREREQ (as in the original patch) will
> > solve it nicely. Users of glibc-2.1.1 will be the odd minority where
> > strchrnul() is available in their libc but not used.
>
> Do you mean this on top of René's patch?  Although I do not
> think I saw "the original patch" that did it this way, I think
> it makes sense.
>
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 11e6df6..dd96f7a 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -183,7 +183,7 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
>                  const void *needle, size_t needlelen);
>  #endif
>
> -#if !defined(__GLIBC__) && !__GLIBC_PREREQ(2, 1)
> +#if !defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 1)
>  #define strchrnul gitstrchrnul
>  static inline char *gitstrchrnul(const char *s, int c)
>  {

I just tested it on my machine (OS X Tiger) now that it's in 'next',
and this breaks the build:

    CC git.o
In file included from builtin.h:4,
                 from git.c:1:
git-compat-util.h:187:48: error: missing binary operator before token "("
make: *** [git.o] Error 1


I don't think I have __GLIBC_PREREQ defined anywhere I can find.

Dave.

  parent reply	other threads:[~2007-11-12  9:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09  0:49 [PATCH 1/2] Add strchrnul() René Scharfe
2007-11-09  1:21 ` Johannes Schindelin
2007-11-09  3:31 ` Jeff King
2007-11-09 10:22 ` Andreas Ericsson
2007-11-09 13:42   ` Jakub Narebski
2007-11-09 13:59     ` Andreas Ericsson
2007-11-09 16:44       ` Jakub Narebski
2007-11-10 11:55   ` [PATCH] Simplify strchrnul() compat code René Scharfe
2007-11-10 14:04     ` Andreas Ericsson
2007-11-11 10:44       ` Junio C Hamano
2007-11-11 12:35         ` Andreas Ericsson
2007-11-12  9:03         ` David Symonds [this message]
2007-11-12  9:12           ` Johannes Sixt
2007-11-12  9:24             ` David Symonds
2007-11-12  9:50               ` Johannes Sixt
2007-11-12  9:52                 ` David Symonds
2007-11-12 10:07                   ` Jakub Narebski
2007-11-12 10:09                   ` [PATCH] Fix preprocessor logic that determines the availablity of strchrnul() 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=ee77f5c20711120103s478e26cdib85f38293423d90c@mail.gmail.com \
    --to=dsymonds@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=madcoder@debian.org \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).