Re: Confusion in usr/include/asm-generic/fcntl.h

Arnd Bergmann
2009-01-26T15:54:18Z

On Friday 23 January 2009, Jaswinder Singh Rajput wrote:
>
> So who wins the race for CONFIG_64BIT and will be right candidate for
> usr/include/asm-generic/fcntl.h:
>
> 1. #if BITS_PER_LONG == 64

namespace pollution => doesn't work

> OR
>
> 2. #if __BITS_PER_LONG == 64

my suggestion, looks good

>
> OR
>
> 3. #ifdef __LP64__

Should work, but not sure if all compilers get it right

>
> OR
>
> 4. #if __SIZEOF_POINTER__ == 8

Never heard of this, but seems fine, probably __SIZEOF_LONG__
would be more logical (but with identical results)

>
> OR
>
> 5. #if LONG_MAX > 2147483647L

requires #include <stdint.h>, which pollutes the namespace => doesn't work

> OR
>
> 6. #ifdef __64BIT

Dangerous, as explained.