| 1 | /* whichos.h |
|---|
| 2 | * Determines which OS Survex will try to compile for |
|---|
| 3 | * Copyright (C) 1993-1995,2002,2003 Olly Betts |
|---|
| 4 | * |
|---|
| 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. |
|---|
| 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 |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | * GNU General Public License for more details. |
|---|
| 14 | * |
|---|
| 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 |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | /* Built-in #define-s that identify compilers: (initals => checked) |
|---|
| 21 | * unix,UNIX Unix systems (?) |
|---|
| 22 | * __TURBOC__ Turbo C |
|---|
| 23 | * MacOSX with apple modified gcc: |
|---|
| 24 | * -D__ppc__ -D__MACH__ -D__APPLE__ -D__APPLE_CC__=932 |
|---|
| 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 |
|---|
| 39 | # if defined(__GNUC__) && defined(__APPLE_CC__) |
|---|
| 40 | /* Mac OS X is Unix underneath */ |
|---|
| 41 | # define OS UNIX |
|---|
| 42 | # endif |
|---|
| 43 | # if (defined (WIN32) || 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 |
|---|