1/* Handcrafted s-mac.h file for building GNU Emacs on Mac OS 9.
2   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
3      2005, 2006, 2007  Free Software Foundation, Inc.
4
5This file is part of GNU Emacs.
6
7GNU Emacs is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Emacs; see the file COPYING.  If not, write to
19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA.  */
21
22/* Contributed by Andrew Choi (akochoi@mac.com).  */
23
24/*
25 *	Define symbols to identify the version of Unix this is.
26 *	Define all the symbols that apply correctly.
27 */
28
29/* #define UNIPLUS */
30/* #define USG5 */
31/* #define USG */
32/* #define HPUX */
33/* #define UMAX */
34/* #define BSD4_1 */
35/* #define BSD4_2 */
36/* #define BSD4_3 */
37/* #define BSD_SYSTEM */
38/* #define VMS */
39
40/* SYSTEM_TYPE should indicate the kind of system you are using.
41 It sets the Lisp variable system-type.  */
42
43#define SYSTEM_TYPE "macos"
44
45/* NOMULTIPLEJOBS should be defined if your system's shell
46 does not have "job control" (the ability to stop a program,
47 run some other program, then continue the first one).  */
48
49#define NOMULTIPLEJOBS
50
51/* Emacs can read input using SIGIO and buffering characters itself,
52   or using CBREAK mode and making C-g cause SIGINT.
53   The choice is controlled by the variable interrupt_input.
54
55   Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
56
57   Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros
58   to indicate whether or not signal-driven I/O is possible.  It uses
59   INTERRUPT_INPUT to decide whether to use it by default.
60
61   SIGIO can be used only on systems that implement it (4.2 and 4.3).
62   CBREAK mode has two disadvantages
63     1) At least in 4.2, it is impossible to handle the Meta key properly.
64        I hear that in system V this problem does not exist.
65     2) Control-G causes output to be discarded.
66        I do not know whether this can be fixed in system V.
67
68   Another method of doing input is planned but not implemented.
69   It would have Emacs fork off a separate process
70   to read the input and send it to the true Emacs process
71   through a pipe. */
72
73/* #define INTERRUPT_INPUT */
74
75/* Letter to use in finding device name of first pty,
76  if system supports pty's.  'a' means it is /dev/ptya0  */
77
78/* #define FIRST_PTY_LETTER 'a' */
79
80/*
81 *	Define HAVE_TERMIOS if the system provides POSIX-style
82 *	functions and macros for terminal control.
83 *
84 *	Define HAVE_TERMIO if the system provides sysV-style ioctls
85 *	for terminal control.
86 *
87 *	Do not define both.  HAVE_TERMIOS is preferred, if it is
88 *	supported on your system.
89 */
90
91/* #define HAVE_TERMIOS */
92#define HAVE_TERMIO
93
94/*
95 *	Define HAVE_PTYS if the system supports pty devices.
96 */
97
98/* #define HAVE_PTYS */
99
100/*
101 *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
102 *      The 4.2 opendir, etc., library functions.
103 */
104
105/* #define NONSYSTEM_DIR_LIBRARY */
106
107/* Define this symbol if your system has the functions bcopy, etc. */
108
109/* #define BSTRING */
110
111/* subprocesses should be defined if you want to
112   have code for asynchronous subprocesses
113   (as used in M-x compile and M-x shell).
114   This is generally OS dependent, and not supported
115   under most USG systems. */
116
117/* #define subprocesses */
118
119/* If your system uses COFF (Common Object File Format) then define the
120   preprocessor symbol "COFF". */
121
122/* #define COFF */
123
124/* define MAIL_USE_FLOCK if the mailer uses flock
125   to interlock access to /usr/spool/mail/$USER.
126   The alternative is that a lock file named
127   /usr/spool/mail/$USER.lock.  */
128
129/* #define MAIL_USE_FLOCK */
130
131/* Define CLASH_DETECTION if you want lock files to be written
132   so that Emacs can tell instantly when you try to modify
133   a file that someone else has modified in his Emacs.  */
134
135/* #define CLASH_DETECTION */
136
137/* Define this if your operating system declares signal handlers to
138   have a type other than the usual.  `The usual' is `void' for ANSI C
139   systems (i.e. when the __STDC__ macro is defined), and `int' for
140   pre-ANSI systems.  If you're using GCC on an older system, __STDC__
141   will be defined, but the system's include files will still say that
142   signal returns int or whatever; in situations like that, define
143   this to be what the system's include files want.  */
144/* #define SIGTYPE int */
145
146/* If the character used to separate elements of the executable path
147   is not ':', #define this to be the appropriate character constant.  */
148/* #define SEPCHAR ':' */
149
150/* Define this if the system can use mmap for buffer text allocation.  */
151/* #define USE_MMAP_FOR_BUFFERS 1 */
152
153/* ============================================================ */
154
155/* Here, add any special hacks needed
156   to make Emacs work on this system.  For example,
157   you might define certain system call names that don't
158   exist on your system, or that do different things on
159   your system and must be used only through an encapsulation
160   (Which you should place, by convention, in sysdep.c).  */
161
162/* Some compilers tend to put everything declared static
163   into the initialized data area, which becomes pure after dumping Emacs.
164   On these systems, you must #define static as nothing to foil this.
165   Note that emacs carefully avoids static vars inside functions.  */
166
167/* #define static */
168
169/* If the system's imake configuration file defines `NeedWidePrototypes'
170   as `NO', we must define NARROWPROTO manually.  Such a define is
171   generated in the Makefile generated by `xmkmf'.  If we don't
172   define NARROWPROTO, we will see the wrong function prototypes
173   for X functions taking float or double parameters.  */
174
175/*  #define NARROWPROTO 1 */
176
177/* ============================================================ */
178
179/* After adding support for a new system, modify the large case
180   statement in the `configure' script to recognize reasonable
181   configuration names, and add a description of the system to
182   `etc/MACHINES'.
183
184   If you've just fixed a problem in an existing configuration file,
185   you should also check `etc/MACHINES' to make sure its descriptions
186   of known problems in that configuration should be updated.  */
187
188#ifdef __MRC__
189/* MrC predefines signal numbers as powers of 2.  */
190#define sigmask(no) (((no) & (no) - 1) ? 1L << ((no) - 1) : (no))
191#define __signal_max 8	      /* There's enough room for the following
192				 signals between 8 and 16, and the
193				 maximum predefined one (32) is less
194				 than 8th power of 2.  */
195#endif
196
197#define SIGHUP (__signal_max+1)
198#define SIGQUIT (__signal_max+2)
199#define SIGTRAP (__signal_max+3)
200#define SIGKILL (__signal_max+4)
201#define SIGALRM (__signal_max+5)
202#define SIGPIPE (__signal_max+6)
203
204#ifdef __MRC__
205#define NSIG SIGTERM  /* largest one in signal.h */
206#else
207#define NSIG (__signal_max+6)
208#endif
209
210#ifdef __MRC__
211#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)
212#elif __MWERKS__
213#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->buffer_ptr - (FILE)->buffer)
214#endif
215
216#ifdef __MWERKS__
217#include <errno.h>
218#ifndef ENOENT
219#define ENOENT 100
220#endif
221#ifndef EXDEV
222#define EXDEV 101
223#endif
224#ifndef EEXIST
225#define EEXIST 102
226#endif
227#ifndef EINTR
228#define EINTR 102
229#endif
230#ifndef EACCES
231#define EACCES 103
232#endif
233#ifndef ENOTDIR
234#define ENOTDIR 104
235#endif
236#ifndef EIO
237#define EIO 105
238#endif
239#ifndef EBADF
240#define EBADF 106
241#endif
242#endif
243
244#define SYSTEM_PURESIZE_EXTRA (200*1024)
245
246/* don't know what this will do, but sysdep.c needs it */
247#define DATA_START 0
248
249/* Limited by CW's 32K limit on local data! */
250#define READ_BUF_SIZE (8 << 10)
251
252#include <utsname.h>
253
254#define SYSV_SYSTEM_DIR
255
256#define SYSTEM_MALLOC
257
258#define _setjmp setjmp
259#define _longjmp longjmp
260
261#define _exit exit
262
263#define main emacs_main
264
265/* Include this here so it won't be include again when #include in emacs
266   sources.  Then undefine the macro definitions in it for unlink, read,
267   write, access, and rmdir.  */
268#ifdef __MWERKS__
269#include <unistd.h>
270#endif
271
272#ifndef X_OK
273#define X_OK 01
274#endif
275
276#undef unlink
277#define unlink sys_unlink
278#undef read
279#define read sys_read
280#undef write
281#define write sys_write
282#undef access
283#define access sys_access
284#undef rmdir
285#define rmdir sys_rmdir
286
287#define open sys_open
288#define creat sys_creat
289
290#define rename sys_rename
291#define fopen sys_fopen
292#define signal sys_signal
293
294#define gmtime sys_gmtime
295#define localtime sys_localtime
296#define ctime sys_ctime
297#define time sys_time
298
299#define index strchr
300#define rindex strrchr
301
302#define PTR POINTER_TYPE *	/* For strftime.c.  */
303
304#define SYMS_SYSTEM syms_of_mac()
305
306#ifdef USE_LSB_TAG
307#ifdef __MRC__
308#define DECL_ALIGN(type, var) type var
309#endif
310#endif
311
312/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
313   stack.  */
314#define GC_MARK_STACK   GC_MAKE_GCPROS_NOOPS
315
316/* arch-tag: 6a941c4b-a419-4d25-80ac-9335053e58b2
317   (do not change this comment) */
318