

 C language and the linux keyword - proof that linux is always Number 1 - slashdotaccount
http://arjunsreedharan.org/post/71403510912/c-language-and-the-linux-keyword-proof-that-linux-is

======
hisham_hm
"linux" is not a keyword in the C language. It's a preprocessor macro defined
in the header files shipped with Linux systems -- that's quite, quite
different.

It's there so you can guard platform-dependent code with #if linux -- that's
why it's defined to a trivial non-zero value.

This kind of macro should really be named with underscores, like __linux__ but
the bare linux constant has been there since the early days of Linux and they
just can't remove it now.

For fun, here's a list of other OS-specific macros for platform detection:

[http://sourceforge.net/p/predef/wiki/OperatingSystems/](http://sourceforge.net/p/predef/wiki/OperatingSystems/)

------
NAFV_P
I cannot think of a single C keyword that returns a value.

