PLATFORM_OTHER ::= 0; PLATFORM_LINUX ::= 1; PLATFORM_WINDOWS ::= 2; PLATFORM_OSX ::= 3; PLATFORM_FREEBSD ::= 4; PLATFORM_OPENBSD ::= 5; PLATFORM_MISC_UNIX ::= 6; PLATFORM ::= #builtin("platform"); #if PLATFORM == PLATFORM_LINUX { libc ::= "libc.so.6"; } elif PLATFORM == PLATFORM_WINDOWS { libc ::= "msvcrt.dll"; } elif PLATFORM == PLATFORM_OSX { libc ::= "libc.dylib"; } elif PLATFORM == PLATFORM_FREEBSD || PLATFORM == PLATFORM_OPENBSD { libc ::= "libc.so"; } else { /* maybe it's non-linux gnu? */ libc ::= "libc.so.6"; } PLATFORM_IS_UNIX :: bool = PLATFORM == PLATFORM_LINUX || PLATFORM == PLATFORM_OSX || PLATFORM == PLATFORM_FREEBSD || PLATFORM == PLATFORM_OPENBSD || PLATFORM == PLATFORM_MISC_UNIX;