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

From: Arnd Bergmann
Date: Mon Jan 26 2009 - 10:54:18 EST


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.

Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/