source: git/src/whichos.h @ f082936

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 f082936 was 5257629, checked in by Olly Betts <olly@…>, 27 years ago

win32

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

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/* > whichos.h
2 * Determines which OS Survex will try to compile for
3 * Copyright (C) 1993-1995 Olly Betts
4 */
5
6/*
71993.06.30 LF only eols
8           incore filename above -> lower case
91993.07.02 added comment about makefiles
101993.07.19 "common.h" -> "osdepend.h"
111993.08.08 added missing linefeed in comment above
121993.08.12 recoded to try to auto-detect
131993.08.13 __MSDOS__ okay under Borland C++
141993.08.15 should cope if UNIX defined on entry and DOS -> MSDOS
151993.08.16 corrected "indentify" to "identify"; fettled
161993.08.18 changed "don't" to "do not" in #error for GCC
171993.12.09 adjusted 'cos DJGPP defines UNIX and __GO32__
18           #undef MSDOS before #define-ing it
191993.12.11 added some support for Microsoft C
201993.12.13 tidied up
211994.03.30 msc defines _MSDOS (and not MSDOS) in ANSI mode
221994.04.10 added TOS
231994.04.27 only include once
241994.06.20 more Norcroft macros
251994.08.26 more Borland macros
261995.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
66#  if (defined(__WIN32__))
67#   undef WIN32
68#   define OS WIN32
69#  endif
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
82# define WIN32  6
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
Note: See TracBrowser for help on using the repository browser.