From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] Simplify strchrnul() compat code
Date: Mon, 12 Nov 2007 11:07:33 +0100 [thread overview]
Message-ID: <fh98ku$da6$1@ger.gmane.org> (raw)
In-Reply-To: ee77f5c20711120152i4955ed3bh484c9ac76a7f1f5c@mail.gmail.com
David Symonds wrote:
> On Nov 12, 2007 8:50 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> -#if !defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 1)
>> +#ifdef __GLIBC_PREREQ
>> +#if __GLIBC_PREREQ(2, 1)
>> +#define HAVE_STRCHRNUL
>> +#endif
>> +#endif
>> +
>> +#ifndef HAVE_STRCHRNUL
>>
>> #define strchrnul gitstrchrnul
>> static inline char *gitstrchrnul(const char *s, int c)
>> {
>
> Yep, that works just fine. Ack.
This version has also the following advantage that you can set
HAVE_STRCHRNULL if above test does not detect it in your library.
Althought you'd better write then:
+#if __GLIBC_PREREQ(2, 1) && !defined(HAVE_STRCHRNUL)
Ack.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2007-11-12 10:07 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
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 [this message]
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='fh98ku$da6$1@ger.gmane.org' \
--to=jnareb@gmail.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).