[d1b1380] | 1 | /* > whichos.h |
---|
| 2 | * Determines which OS Survex will try to compile for |
---|
| 3 | * Copyright (C) 1993-1995 Olly Betts |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | /* |
---|
| 7 | 1993.06.30 LF only eols |
---|
| 8 | incore filename above -> lower case |
---|
| 9 | 1993.07.02 added comment about makefiles |
---|
| 10 | 1993.07.19 "common.h" -> "osdepend.h" |
---|
| 11 | 1993.08.08 added missing linefeed in comment above |
---|
| 12 | 1993.08.12 recoded to try to auto-detect |
---|
| 13 | 1993.08.13 __MSDOS__ okay under Borland C++ |
---|
| 14 | 1993.08.15 should cope if UNIX defined on entry and DOS -> MSDOS |
---|
| 15 | 1993.08.16 corrected "indentify" to "identify"; fettled |
---|
| 16 | 1993.08.18 changed "don't" to "do not" in #error for GCC |
---|
| 17 | 1993.12.09 adjusted 'cos DJGPP defines UNIX and __GO32__ |
---|
| 18 | #undef MSDOS before #define-ing it |
---|
| 19 | 1993.12.11 added some support for Microsoft C |
---|
| 20 | 1993.12.13 tidied up |
---|
| 21 | 1994.03.30 msc defines _MSDOS (and not MSDOS) in ANSI mode |
---|
| 22 | 1994.04.10 added TOS |
---|
| 23 | 1994.04.27 only include once |
---|
| 24 | 1994.06.20 more Norcroft macros |
---|
| 25 | 1994.08.26 more Borland macros |
---|
| 26 | 1995.10.10 added __DJGPP__ to DJGPP macro list |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /* Built-in #define-s that identify compilers: (initals => checked) |
---|
| 30 | * __arm (Acorn) Norcroft RISC OS ARM C vsn 4.00 (OJWB) |
---|
| 31 | * also __CC_NORCROFT __riscos __acorn |
---|
| 32 | * unix,UNIX Unix systems (?) |
---|
| 33 | * __MSDOS__ Borland C++ (OJWB) |
---|
| 34 | * [also __BORLANDC__ (version num) __TURBOC__ (version num)] |
---|
| 35 | * __TURBOC__ Turbo C |
---|
| 36 | * __GO32__,unix,MSDOS,__DJGPP__ DJGPP (W) (also GO32, __MSDOS__) |
---|
| 37 | * _MSDOS, (MSDOS not ANSI) Microsoft C (OJWB) |
---|
| 38 | * MC68000, mc68000, SOZOBON, ATARI_ST, TOS|MINIX |
---|
| 39 | * Sozobon C (OJWB from MM's docs) |
---|
| 40 | */ |
---|
| 41 | |
---|
| 42 | #ifndef WHICHOS_H |
---|
| 43 | # define WHICHOS_H |
---|
| 44 | |
---|
| 45 | /* if OS has been defined, then assume they know what they're up to */ |
---|
| 46 | # ifndef OS |
---|
| 47 | /* Okay, let's try to be clever and auto-detect - if OS gets defined more |
---|
| 48 | * than once, compiler should barf and warn user |
---|
| 49 | */ |
---|
| 50 | # ifdef __arm |
---|
| 51 | # define OS RISCOS /* RISCiX too? */ |
---|
| 52 | # endif |
---|
| 53 | # if (defined (_MSDOS) || defined(MSDOS) || defined(__MSDOS__)) |
---|
| 54 | # undef unix /* DJGPP defines this */ |
---|
| 55 | # undef MSDOS |
---|
| 56 | # define OS MSDOS |
---|
| 57 | # endif |
---|
| 58 | # if (defined(unix) || defined(UNIX)) |
---|
| 59 | # undef UNIX /* to stop it causing problems later */ |
---|
| 60 | # define OS UNIX |
---|
| 61 | # endif |
---|
| 62 | # if (defined(ATARI_ST) || defined(TOS)) |
---|
| 63 | # undef TOS |
---|
| 64 | # define OS TOS |
---|
| 65 | # endif |
---|
[5257629] | 66 | # if (defined(__WIN32__)) |
---|
| 67 | # undef WIN32 |
---|
| 68 | # define OS WIN32 |
---|
| 69 | # endif |
---|
[d1b1380] | 70 | /* etc ... */ |
---|
| 71 | # endif /*!defined(OS)*/ |
---|
| 72 | |
---|
| 73 | /* predefine OS to be one of these (eg in the make file) to force a compile |
---|
| 74 | * for an OS/compiler combination not support or that clashes somehow. |
---|
| 75 | * eg with -DOS=AMIGA to predefine OS as AMIGA |
---|
| 76 | */ |
---|
| 77 | # define RISCOS 1 |
---|
| 78 | # define MSDOS 2 |
---|
| 79 | # define UNIX 3 |
---|
| 80 | # define AMIGA 4 |
---|
| 81 | # define TOS 5 |
---|
[5257629] | 82 | # define WIN32 6 |
---|
[d1b1380] | 83 | /* Just numbers, not a rating system ;) */ |
---|
| 84 | |
---|
| 85 | /* One last check, in case nothing worked */ |
---|
| 86 | # ifndef OS |
---|
| 87 | # error Sorry, do not know what OS to compile for - look at whichos.h |
---|
| 88 | # endif |
---|
| 89 | #endif |
---|