source: git/src/whichos.h @ 745433f

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
Last change on this file since 745433f was 6c11fb3, checked in by Olly Betts <olly@…>, 23 years ago

Added code to recognise Mac OS X and pretend it's Unix (it is underneath).

git-svn-id: file:///home/survex-svn/survex/trunk@1726 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/* whichos.h
2 * Determines which OS Survex will try to compile for
3 * Copyright (C) 1993-1995,2002 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 * __arm                        (Acorn) Norcroft RISC OS ARM C vsn 4.00 (OJWB)
22 *   also __CC_NORCROFT __riscos __acorn
23 * unix,UNIX                    Unix systems (?)
24 * __MSDOS__                    Borland C++ (OJWB)
25 *       [also __BORLANDC__ (version num) __TURBOC__ (version num)]
26 * __TURBOC__                   Turbo C
27 * __GO32__,unix,MSDOS,__DJGPP__
28 *                              DJGPP (W) (also GO32, __MSDOS__)
29 * _MSDOS, (MSDOS not ANSI)     Microsoft C (OJWB)
30 * MC68000, mc68000, SOZOBON, ATARI_ST, TOS|MINIX
31 *                              Sozobon C (OJWB from MM's docs)
32 */
33
34#ifndef WHICHOS_H
35# define WHICHOS_H
36
37/* if OS has been defined, then assume they know what they're up to */
38# ifndef OS
39/* Okay, let's try to be clever and auto-detect - if OS gets defined more
40 * than once, compiler should barf and warn user
41 */
42#  ifdef __riscos
43#   define OS RISCOS
44#  endif
45#  if (defined (_MSDOS) || defined(MSDOS) || defined(__MSDOS__))
46#   undef unix /* DJGPP defines this */
47#   undef MSDOS
48#   define OS MSDOS
49#  endif
50#  if (defined(unix) || defined(UNIX))
51#   undef UNIX /* to stop it causing problems later */
52#   define OS UNIX
53#  endif
54#  if defined(__GNUC__) && defined(__APPLE_CC__)
55/* Mac OS X is Unix underneath */
56#   define OS UNIX
57#  endif
58#  if (defined(ATARI_ST) || defined(TOS))
59#   undef TOS
60#   define OS TOS
61#  endif
62#  if (defined(__WIN32__))
63#   undef WIN32
64#   define OS WIN32
65#  endif
66/* etc ... */
67# endif /*!defined(OS)*/
68
69/* predefine OS to be one of these (eg in the make file) to force a compile
70 * for an OS/compiler combination not support or that clashes somehow.
71 * eg with -DOS=AMIGA to predefine OS as AMIGA
72 */
73# define RISCOS 1
74# define MSDOS  2
75# define UNIX   3
76# define AMIGA  4
77# define TOS    5
78# define WIN32  6
79/* Just numbers, not a rating system ;) */
80
81/* One last check, in case nothing worked */
82# ifndef OS
83#  error Sorry, do not know what OS to compile for - look at whichos.h
84# endif
85#endif
Note: See TracBrowser for help on using the repository browser.