Re: where is #define __linux__
On Mon, Jan 08, 2001 at 11:05:54PM -0800, Aaron Brashears wrote:
| I'm doing some code which is intended to work on linux and sunos. I
| was poking through the header files in /usr/include on my debian box
| and found a line in g++-3/stl_config.h which specified:
|
| #if defined(__linux__)
|
| after a quick test, I found out this is true on linux, and not true on
| solaris when using gcc. However, grep -r '__linux__' * doesn't reveal
| the location where it is in fact #defined.
|
Not sure, but it could be defined in the compiler itself.
| Anyone have a clue what's going on? While on the topic, is there a
| magic preprocessor definition that lets me know if I'm on
| sunos/solaris?
|
I know that __GNUC__ and __GNUG__ are defined if using gcc/g++
respectively, but I don't know of a Solaris specific label. Maybe
grepping through the g++ sources for __.*__ would help?
-D
Reply to: