1 | /* > whichos.h |
---|
2 | * Determines which OS Survex will try to compile for |
---|
3 | * Copyright (C) 1993-1995 Olly Betts |
---|
4 | */ |
---|
5 | |
---|
6 | /* Built-in #define-s that identify compilers: (initals => checked) |
---|
7 | * __arm (Acorn) Norcroft RISC OS ARM C vsn 4.00 (OJWB) |
---|
8 | * also __CC_NORCROFT __riscos __acorn |
---|
9 | * unix,UNIX Unix systems (?) |
---|
10 | * __MSDOS__ Borland C++ (OJWB) |
---|
11 | * [also __BORLANDC__ (version num) __TURBOC__ (version num)] |
---|
12 | * __TURBOC__ Turbo C |
---|
13 | * __GO32__,unix,MSDOS,__DJGPP__ DJGPP (W) (also GO32, __MSDOS__) |
---|
14 | * _MSDOS, (MSDOS not ANSI) Microsoft C (OJWB) |
---|
15 | * MC68000, mc68000, SOZOBON, ATARI_ST, TOS|MINIX |
---|
16 | * Sozobon C (OJWB from MM's docs) |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef WHICHOS_H |
---|
20 | # define WHICHOS_H |
---|
21 | |
---|
22 | /* if OS has been defined, then assume they know what they're up to */ |
---|
23 | # ifndef OS |
---|
24 | /* Okay, let's try to be clever and auto-detect - if OS gets defined more |
---|
25 | * than once, compiler should barf and warn user |
---|
26 | */ |
---|
27 | # ifdef __riscos |
---|
28 | # define OS RISCOS |
---|
29 | # endif |
---|
30 | # if (defined (_MSDOS) || defined(MSDOS) || defined(__MSDOS__)) |
---|
31 | # undef unix /* DJGPP defines this */ |
---|
32 | # undef MSDOS |
---|
33 | # define OS MSDOS |
---|
34 | # endif |
---|
35 | # if (defined(unix) || defined(UNIX)) |
---|
36 | # undef UNIX /* to stop it causing problems later */ |
---|
37 | # define OS UNIX |
---|
38 | # endif |
---|
39 | # if (defined(ATARI_ST) || defined(TOS)) |
---|
40 | # undef TOS |
---|
41 | # define OS TOS |
---|
42 | # endif |
---|
43 | # if (defined(__WIN32__)) |
---|
44 | # undef WIN32 |
---|
45 | # define OS WIN32 |
---|
46 | # endif |
---|
47 | /* etc ... */ |
---|
48 | # endif /*!defined(OS)*/ |
---|
49 | |
---|
50 | /* predefine OS to be one of these (eg in the make file) to force a compile |
---|
51 | * for an OS/compiler combination not support or that clashes somehow. |
---|
52 | * eg with -DOS=AMIGA to predefine OS as AMIGA |
---|
53 | */ |
---|
54 | # define RISCOS 1 |
---|
55 | # define MSDOS 2 |
---|
56 | # define UNIX 3 |
---|
57 | # define AMIGA 4 |
---|
58 | # define TOS 5 |
---|
59 | # define WIN32 6 |
---|
60 | /* Just numbers, not a rating system ;) */ |
---|
61 | |
---|
62 | /* One last check, in case nothing worked */ |
---|
63 | # ifndef OS |
---|
64 | # error Sorry, do not know what OS to compile for - look at whichos.h |
---|
65 | # endif |
---|
66 | #endif |
---|