C detecting that I'm compiling for FreeBSD

If, say, I'm compiling with gcc(1) under Linux, a section of code will compile if it looks like this:
Code:
#if __linux__
/* your ad here */
#endif
How do I do such conditional compilation for FreeBSD (other than inverting the __linux__ test)? I'm hoping the answer would apply equally to clang(1) and gcc(1).

And a related question: Is there a way (at least for clang(1), but preferably also for gcc(1) running under FreeBSD) to simply dump all symbols defined at compile time, so I can browse through those beginning with an underscore, and find the answer to the previous question for myself?
 
Back
Top