blob: 54d64d6be22586dd4a1537ccc6de738335d46d47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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;
|