Mercurial > emacs
comparison mac/inc/s-mac.h @ 88155:d7ddb3e565de
sync with trunk
author | Henrik Enberg <henrik.enberg@telia.com> |
---|---|
date | Mon, 16 Jan 2006 00:03:54 +0000 |
parents | 01b93e5e53a7 |
children |
comparison
equal
deleted
inserted
replaced
88154:8ce476d3ba36 | 88155:d7ddb3e565de |
---|---|
1 /* Handcrafted s-mac.h file for building GNU Emacs on the Macintosh. | 1 /* Handcrafted s-mac.h file for building GNU Emacs on Mac OS 9. |
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc. | 2 Copyright (C) 1999, 2000, 2002, 2003, 2004, |
3 2005 Free Software Foundation, Inc. | |
3 | 4 |
4 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
5 | 6 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 GNU General Public License for more details. | 15 GNU General Public License for more details. |
15 | 16 |
16 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
17 along with GNU Emacs; see the file COPYING. If not, write to | 18 along with GNU Emacs; see the file COPYING. If not, write to |
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02110-1301, USA. */ |
20 | 21 |
21 /* Contributed by Andrew Choi (akochoi@mac.com). */ | 22 /* Contributed by Andrew Choi (akochoi@mac.com). */ |
22 | 23 |
23 /* | 24 /* |
24 * Define symbols to identify the version of Unix this is. | 25 * Define symbols to identify the version of Unix this is. |
51 or using CBREAK mode and making C-g cause SIGINT. | 52 or using CBREAK mode and making C-g cause SIGINT. |
52 The choice is controlled by the variable interrupt_input. | 53 The choice is controlled by the variable interrupt_input. |
53 | 54 |
54 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO) | 55 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO) |
55 | 56 |
56 Emacs uses the presence or absence of the SIGIO macro to indicate | 57 Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros |
57 whether or not signal-driven I/O is possible. It uses | 58 to indicate whether or not signal-driven I/O is possible. It uses |
58 INTERRUPT_INPUT to decide whether to use it by default. | 59 INTERRUPT_INPUT to decide whether to use it by default. |
59 | 60 |
60 SIGIO can be used only on systems that implement it (4.2 and 4.3). | 61 SIGIO can be used only on systems that implement it (4.2 and 4.3). |
61 CBREAK mode has two disadvantages | 62 CBREAK mode has two disadvantages |
62 1) At least in 4.2, it is impossible to handle the Meta key properly. | 63 1) At least in 4.2, it is impossible to handle the Meta key properly. |
144 | 145 |
145 /* If the character used to separate elements of the executable path | 146 /* If the character used to separate elements of the executable path |
146 is not ':', #define this to be the appropriate character constant. */ | 147 is not ':', #define this to be the appropriate character constant. */ |
147 /* #define SEPCHAR ':' */ | 148 /* #define SEPCHAR ':' */ |
148 | 149 |
150 /* Define this if the system can use mmap for buffer text allocation. */ | |
151 /* #define USE_MMAP_FOR_BUFFERS 1 */ | |
152 | |
149 /* ============================================================ */ | 153 /* ============================================================ */ |
150 | 154 |
151 /* Here, add any special hacks needed | 155 /* Here, add any special hacks needed |
152 to make Emacs work on this system. For example, | 156 to make Emacs work on this system. For example, |
153 you might define certain system call names that don't | 157 you might define certain system call names that don't |
160 On these systems, you must #define static as nothing to foil this. | 164 On these systems, you must #define static as nothing to foil this. |
161 Note that emacs carefully avoids static vars inside functions. */ | 165 Note that emacs carefully avoids static vars inside functions. */ |
162 | 166 |
163 /* #define static */ | 167 /* #define static */ |
164 | 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 | |
165 /* ============================================================ */ | 177 /* ============================================================ */ |
166 | 178 |
167 /* After adding support for a new system, modify the large case | 179 /* After adding support for a new system, modify the large case |
168 statement in the `configure' script to recognize reasonable | 180 statement in the `configure' script to recognize reasonable |
169 configuration names, and add a description of the system to | 181 configuration names, and add a description of the system to |
172 If you've just fixed a problem in an existing configuration file, | 184 If you've just fixed a problem in an existing configuration file, |
173 you should also check `etc/MACHINES' to make sure its descriptions | 185 you should also check `etc/MACHINES' to make sure its descriptions |
174 of known problems in that configuration should be updated. */ | 186 of known problems in that configuration should be updated. */ |
175 | 187 |
176 #ifdef __MRC__ | 188 #ifdef __MRC__ |
177 #define __signal_max SIGTERM /* largest one in signal.h */ | 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. */ | |
178 #endif | 195 #endif |
179 | 196 |
180 #define SIGHUP (__signal_max+1) | 197 #define SIGHUP (__signal_max+1) |
181 #define SIGQUIT (__signal_max+2) | 198 #define SIGQUIT (__signal_max+2) |
182 #define SIGTRAP (__signal_max+3) | 199 #define SIGTRAP (__signal_max+3) |
183 #define SIGKILL (__signal_max+4) | 200 #define SIGKILL (__signal_max+4) |
184 #define SIGALRM (__signal_max+5) | 201 #define SIGALRM (__signal_max+5) |
185 #define SIGPIPE (__signal_max+6) | 202 #define SIGPIPE (__signal_max+6) |
203 | |
204 #ifdef __MRC__ | |
205 #define NSIG SIGTERM /* largest one in signal.h */ | |
206 #else | |
186 #define NSIG (__signal_max+6) | 207 #define NSIG (__signal_max+6) |
208 #endif | |
187 | 209 |
188 #ifdef __MRC__ | 210 #ifdef __MRC__ |
189 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) | 211 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) |
190 #elif __MWERKS__ | 212 #elif __MWERKS__ |
191 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->buffer_ptr - (FILE)->buffer) | 213 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->buffer_ptr - (FILE)->buffer) |
226 | 248 |
227 /* Limited by CW's 32K limit on local data! */ | 249 /* Limited by CW's 32K limit on local data! */ |
228 #define READ_BUF_SIZE (8 << 10) | 250 #define READ_BUF_SIZE (8 << 10) |
229 | 251 |
230 #include <utsname.h> | 252 #include <utsname.h> |
231 void read_input_waiting (); | |
232 | |
233 /* #define GETTIMEOFDAY_ONE_ARGUMENT */ | |
234 | 253 |
235 #define SYSV_SYSTEM_DIR | 254 #define SYSV_SYSTEM_DIR |
236 | 255 |
237 #define SYSTEM_MALLOC | 256 #define SYSTEM_MALLOC |
238 | |
239 /* Constants such as O_RDONLY are defined in fcntl.h. Best solution is | |
240 really to patch individual files to include it: callproc.c, doc.c, | |
241 fileio.c, getloadavg.c, lread.c, and termcap.c. */ | |
242 #include <fcntl.h> | |
243 | 257 |
244 #define _setjmp setjmp | 258 #define _setjmp setjmp |
245 #define _longjmp longjmp | 259 #define _longjmp longjmp |
246 | 260 |
247 #define _exit exit | 261 #define _exit exit |
251 /* Include this here so it won't be include again when #include in emacs | 265 /* Include this here so it won't be include again when #include in emacs |
252 sources. Then undefine the macro definitions in it for unlink, read, | 266 sources. Then undefine the macro definitions in it for unlink, read, |
253 write, access, and rmdir. */ | 267 write, access, and rmdir. */ |
254 #ifdef __MWERKS__ | 268 #ifdef __MWERKS__ |
255 #include <unistd.h> | 269 #include <unistd.h> |
270 #endif | |
271 | |
272 #ifndef X_OK | |
273 #define X_OK 01 | |
256 #endif | 274 #endif |
257 | 275 |
258 #undef unlink | 276 #undef unlink |
259 #define unlink sys_unlink | 277 #define unlink sys_unlink |
260 #undef read | 278 #undef read |
276 #define gmtime sys_gmtime | 294 #define gmtime sys_gmtime |
277 #define localtime sys_localtime | 295 #define localtime sys_localtime |
278 #define ctime sys_ctime | 296 #define ctime sys_ctime |
279 #define time sys_time | 297 #define time sys_time |
280 | 298 |
281 #ifndef bcmp | 299 #define index strchr |
282 #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) | 300 #define rindex strrchr |
283 #endif | 301 |
284 #ifndef bcopy | 302 #define PTR POINTER_TYPE * /* For strftime.c. */ |
285 #define bcopy(s, d, n) memcpy ((d), (s), (n)) | 303 |
286 #endif | 304 #define SYMS_SYSTEM syms_of_mac() |
287 #ifndef bzero | 305 |
288 #define bzero(s, n) memset ((s), 0, (n)) | 306 #ifdef USE_LSB_TAG |
289 #endif | |
290 | |
291 extern char *index (const char *, int); | |
292 | |
293 /* MPW strftime broken for "%p" format */ | |
294 #ifdef __MRC__ | 307 #ifdef __MRC__ |
295 #define strftime sys_strftime | 308 #define DECL_ALIGN(type, var) type var |
296 #endif | 309 #endif |
297 | 310 #endif |
298 #include <time.h> | 311 |
299 /* Editfns.c includes types.h which indirectly includes time.h before config.h. | 312 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the |
300 So gmtime (localtime) is defined and not sys_gmtime (sys_localtime). Define | 313 stack. */ |
301 here explicitly. */ | 314 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS |
302 extern struct tm *sys_gmtime (const time_t *); | 315 |
303 extern struct tm *sys_localtime (const time_t *); | 316 /* arch-tag: 6a941c4b-a419-4d25-80ac-9335053e58b2 |
304 extern char *sys_ctime (const time_t *); | 317 (do not change this comment) */ |
305 extern time_t sys_time (time_t *); | |
306 | |
307 /* Emacs.c includes signal.h before config.h. Define this to make it happy. */ | |
308 #ifdef __MRC__ | |
309 #include <signal.h> | |
310 extern __sigfun sys_signal (int signal_num, __sigfun signal_func); | |
311 #elif __MWERKS__ | |
312 #include <signal.h> | |
313 extern __signal_func_ptr sys_signal (int signal_num, __signal_func_ptr signal_func); | |
314 #endif | |
315 | |
316 extern double atof (const char *); | |
317 | |
318 #define volatile | |
319 | |
320 #define SYMS_SYSTEM syms_of_mac() |