1
/******************************************************************************
3
* Copyright (C) 2006-2009 by Tor Andersson. *
5
* This file is part of Gargoyle. *
7
* Gargoyle is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
12
* Gargoyle is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
17
* You should have received a copy of the GNU General Public License *
18
* along with Gargoyle; if not, write to the Free Software *
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
21
*****************************************************************************/
24
$Header: d:/cvsroot/tads/TADS2/OS.H,v 1.2 1999/05/17 02:52:12 MJRoberts Exp $
28
* Copyright (c) 1991, 2002 Michael J. Roberts. All Rights Reserved.
30
* Please see the accompanying license file, LICENSE.TXT, for information
31
* on using and copying this software.
35
os.h - operating system definitions
37
Definitions that vary by operating system
39
Do NOT put your system-specific definitions in this file, EXCEPT for
40
your system-specific #include lines.
42
We want to avoid piling up a huge tree of #ifdef's, since it's almost
43
impossible to decipher such code. Instead, we want to isolate all of
44
the code for each platform in its own header file -- this way, it
45
should be easy to figure out what code is compiled on each system.
47
So, when porting this code to a new platform, you should first
48
create an osxxx.h file for your platform (for example, on Windows,
49
the file is oswin.h), then add to this file an ifdef'd include for
50
your file, something like this:
53
#include "osfrobnix.h"
56
These should generally be the ONLY lines in this file that pertain
57
to your system. Everything else for your system should be defined
60
Also note that some definitions belong in your *hardware* file,
61
rather than your operating system file. Since many types of hardware
62
have several operating systems, and many operating systems run on
63
more than one type of hardware, definitions that pertain to a
64
particular type of hardware should be isolated in a separate file.
65
So, if you're adding a new hardware platform as well as (or instead
66
of) a new operating system, you should create a new h_xxx.h file
67
(in the "hardware" source subdirectory), and add an include line
74
Note that you may have to adjust your makefile's CFLAGS so that
75
the proper hardware and software configuration is selected via -D
76
options (or your local equivalent).
78
10/17/98 MJRoberts - creation (from TADS 2 os.h, los.h, etc)
85
* For C++ files, define externals with C linkage
92
/* ------------------------------------------------------------------------ */
94
* Include the appropriate hardware-specific header.
108
* Intel x86 processors - 32-bit
115
* Intel x86 processors - 64-bit
118
#include "h_ix86_64.h"
129
* Qt. This isn't *truly* a hardware platform, but it looks like one to
130
* us, because it provides its own hardware virtualization scheme. Rather
131
* than trying to figure out what sort of physical hardware we're
132
* targeting, we can simply define our hardware virtualization macros and
133
* functions in terms of Qt's hardware virtualization APIs, and let Qt take
134
* care of providing the target-specific implementation of those APIs.
140
/* add others here */
142
/* ------------------------------------------------------------------------ */
144
* Include the portable OS interface type definitions. These types can
145
* be used within OS-specific headers, so this type definitions header
146
* must be included before any of the OS-specific headers.
148
#include "osifctyp.h"
151
/* ------------------------------------------------------------------------ */
153
* Include the appropriate OS-specific header. We switch on system type
154
* here to avoid a big pile of ifdef's for each system scattered among
155
* all of the headers, and instead just select one big file for each
156
* system-specific definitions.
168
/* Windows-specific definitions are in oswin.h */
172
/* OS/2-specific definnitions are in osos2.h */
175
/* DOS-specific definitions are in osdos.h */
182
/* macintosh definitions (Mac OS <=9) are in osmac.h */
187
/* macintosh OS X definitions are in osmacosx.h */
188
#include "osmacosx.h"
192
/* unix definitions are in osunixt.h */
197
/* Atari ST definitions are in osatari.h */
202
/* glk definitions are in os_glk.h */
211
/* Qt-specific definitions are in osqt.h */
217
* FrobTADS definitions are in osfrobtads.h. (FrobTADS isn't really an OS,
218
* but from our perspective it looks like one, since it implements the
219
* various osifc entrypoints. FrobTADS further virtualizes access to
220
* several Curses-style terminal i/o APIs, but we don't care about that; we
221
* just care that it provides our osifc implementations.)
223
#include "osfrobtads.h"
226
#endif /* SPATTERLIGHT */
228
/* **************** add other systems here **************** */
232
* Done with C linkage section (osifc.h has its own)
239
/* ------------------------------------------------------------------------ */
241
* Include the generic interface definitions for routines that must be
242
* implemented separately on each platform.
244
* Note that we include this file *after* including the system-specific
245
* osxxx.h header -- this allows definitions in the osxxx.h header to
246
* override certain defaults in osifc.h by #defining symbols to indicate
247
* to osifc.h that it should not include the defaults. Refer to osifc.h
248
* for details of such overridable definitions.
253
/* ------------------------------------------------------------------------ */
255
* If the system "long description" (for the banner) isn't defined,
256
* make it the same as the platform ID string.
258
#ifndef OS_SYSTEM_LDESC
259
# define OS_SYSTEM_LDESC OS_SYSTEM_NAME
262
#endif /* OS_INCLUDED */