[421b7d2] | 1 | /* whichos.h |
---|
[d1b1380] | 2 | * Determines which OS Survex will try to compile for |
---|
[63dc4eb] | 3 | * Copyright (C) 1993-1995,2002,2003 Olly Betts |
---|
[846746e] | 4 | * |
---|
[89231c4] | 5 | * This program is free software; you can redistribute it and/or modify |
---|
| 6 | * it under the terms of the GNU General Public License as published by |
---|
| 7 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 8 | * (at your option) any later version. |
---|
[846746e] | 9 | * |
---|
| 10 | * This program is distributed in the hope that it will be useful, |
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
[89231c4] | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 13 | * GNU General Public License for more details. |
---|
[846746e] | 14 | * |
---|
[89231c4] | 15 | * You should have received a copy of the GNU General Public License |
---|
| 16 | * along with this program; if not, write to the Free Software |
---|
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
[d1b1380] | 18 | */ |
---|
| 19 | |
---|
| 20 | /* Built-in #define-s that identify compilers: (initals => checked) |
---|
[421b7d2] | 21 | * unix,UNIX Unix systems (?) |
---|
| 22 | * __TURBOC__ Turbo C |
---|
[6854d5d] | 23 | * MacOSX with apple modified gcc: |
---|
| 24 | * -D__ppc__ -D__MACH__ -D__APPLE__ -D__APPLE_CC__=932 |
---|
[d1b1380] | 25 | */ |
---|
| 26 | |
---|
| 27 | #ifndef WHICHOS_H |
---|
| 28 | # define WHICHOS_H |
---|
| 29 | |
---|
| 30 | /* if OS has been defined, then assume they know what they're up to */ |
---|
| 31 | # ifndef OS |
---|
| 32 | /* Okay, let's try to be clever and auto-detect - if OS gets defined more |
---|
| 33 | * than once, compiler should barf and warn user |
---|
| 34 | */ |
---|
| 35 | # if (defined(unix) || defined(UNIX)) |
---|
| 36 | # undef UNIX /* to stop it causing problems later */ |
---|
| 37 | # define OS UNIX |
---|
| 38 | # endif |
---|
[6c11fb3] | 39 | # if defined(__GNUC__) && defined(__APPLE_CC__) |
---|
| 40 | /* Mac OS X is Unix underneath */ |
---|
| 41 | # define OS UNIX |
---|
| 42 | # endif |
---|
[63dc4eb] | 43 | # if (defined (WIN32) || defined(__WIN32__)) |
---|
[5257629] | 44 | # undef WIN32 |
---|
| 45 | # define OS WIN32 |
---|
| 46 | # endif |
---|
[d1b1380] | 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 | */ |
---|
[2fdd67c] | 54 | //# define RISCOS 1 |
---|
| 55 | //# define MSDOS 2 |
---|
[d1b1380] | 56 | # define UNIX 3 |
---|
[2fdd67c] | 57 | //# define AMIGA 4 |
---|
| 58 | //# define TOS 5 |
---|
[5257629] | 59 | # define WIN32 6 |
---|
[d1b1380] | 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 |
---|