Here is a list of GCC define's that will help you too implement support for many OS's in a single codebase.
(The list..)
__FreeBSD__
__OpenBSD__
__NetBSD__
__bsdi__
__DARWIN__
__DragonFly__
__sun
__linux__
__CYGWIN__
Also, if you use MinGW..
__MINGW32__
__MINGW32_MAJOR_VERSION
__MINGW32_MINOR_VERSION
The host GCC defines the appropriate one automatically!, This means you can support multiple Operating systems without having to define OS specific flags like -DLINUX manually..
Example on how it works.. input.c
#include <stdio.h>
int main(void)
{
#ifdef __OpenBSD__
printf("Yay, Your using OpenBSD..\n");
#else
printf("Ah, Not running OpenBSD eh?..\n");
#endif
}
(just gcc -o output input.c)
I'm guessing a lot of the developers know of this already, But others may find this list fairly helpful as it can take awile trying to google them all

