bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH 04/21] stdint: typedef gl_intptr_t and gl_uintptr_t correctly


From: KO Myung-Hun
Subject: Re: [PATCH 04/21] stdint: typedef gl_intptr_t and gl_uintptr_t correctly on OS/2 kLIBC
Date: Tue, 02 Dec 2014 13:45:41 +0900
User-agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.6esrpre) Gecko/20120715 Firefox/10.0.6esrpre SeaMonkey/2.7.2

Hi/2.

Paul Eggert wrote:
> KO Myung-Hun wrote:
>> +#ifndef __KLIBC__
>>   typedef long int gl_intptr_t;
>>   typedef unsigned long int gl_uintptr_t;
>> +#else
>> +typedef int gl_intptr_t;
>> +typedef unsigned int gl_uintptr_t;
>> +#endif
> 
> This looks brittle.
> 
> First, why is it used at all?  That is, what's wrong with kLIBC's
> stdint.h, which causes gnulib to replace stdint.h?
> 

Sorry, I didn't check this.

> Second, since kLIBC has its own intptr_t etc., I expect it'll be better
> to use kLIBC's version rather than guess what it will be in future
> versions.  How about something like this instead?
> 
> /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
>    definitions of intptr_t and uintptr_t (which use int and unsigned)
>    to avoid clashes with declarations of system functions like sbrk.  */
> #ifndef _INTPTR_T_DECLARED
> # undef intptr_t
> # undef uintptr_t
> typedef long int gl_intptr_t;
> typedef unsigned long int gl_uintptr_t;
> # define intptr_t gl_intptr_t
> # define uintptr_t gl_uintptr_t
> #endif

This works well. Thanks.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

Attachment: 0001-stdint-check-_INTPTR_T_DECLARED-before-defining-intp.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]