tech-userlevel archive

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

Re: Definitions of types also as macros



On 09.11.2018 12:17, Klaus Klein wrote:
> On Thu, Nov 08, 2018 at 09:08:04AM +0000, David Holland wrote:
>> On Tue, Nov 06, 2018 at 03:07:16PM +0000, coypu%sdf.org@localhost wrote:
>>  > I wanna do this, looks good?
>>
>> It should probably use double wings:
>>
>>  > -#ifndef	int8_t
>>  > +#ifndef	_BSD_INT8_T_
>>
>>    +#ifndef	__BSD_INT8_T__
> 
> In terms of namespace consumption, the single leading underscore
> followed by an uppercase letter as used here is sufficient.
> 
> 
> - Klaus
> 

We alredy use this syntax, eg. in <sys/timespec.h>:

#ifdef  _BSD_TIME_T_
typedef _BSD_TIME_T_    time_t;
#undef  _BSD_TIME_T_
#endif

(however here the ifdef is switched for some reason)

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index