Re: [PATCH] Simplify strchrnul() compat code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Symonds wrote:
> On Nov 12, 2007 8:50 PM, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> 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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux