Move more stuff from src/s to configure
[bpt/emacs.git] / src / s / darwin.h
CommitLineData
e0f712ba 1/* System description header file for Darwin (Mac OS X).
e9bffc61 2
acaf905b 3Copyright (C) 2001-2012 Free Software Foundation, Inc.
e0f712ba
AC
4
5This file is part of GNU Emacs.
6
4b158629 7GNU Emacs is free software: you can redistribute it and/or modify
e0f712ba 8it under the terms of the GNU General Public License as published by
4b158629
GM
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
e0f712ba
AC
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
4b158629 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
e0f712ba
AC
19
20
e05aebe9
GM
21/* Define symbols to identify the version of Unix this is.
22 Define all the symbols that apply correctly. */
e0f712ba
AC
23#define BSD4_2
24/* BSD4_3 and BSD4_4 are already defined in sys/param.h */
e0f712ba 25#define BSD_SYSTEM
e0f712ba 26
14145fa3
AR
27/* More specific than the above two. We cannot use __APPLE__ as this
28 may not be defined on non-OSX Darwin, and we cannot define DARWIN
29 here because Panther and lower CoreFoundation.h uses DARWIN to
e05aebe9 30 distinguish OS X from pure Darwin. */
14145fa3
AR
31#define DARWIN_OS
32
e0f712ba
AC
33/* Letter to use in finding device name of first pty,
34 if system supports pty's. 'a' means it is /dev/ptya0 */
e0f712ba
AC
35#define FIRST_PTY_LETTER 'p'
36
e05aebe9 37/* Run only once. We need a `for'-loop because the code uses `continue'. */
be02381c 38#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
658b9b93
YM
39#define PTY_NAME_SPRINTF /* none */
40#define PTY_TTY_NAME_SPRINTF /* none */
41/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
42 But we don't have to block SIGCHLD because it is blocked in the
43 implementation of grantpt. */
44#define PTY_OPEN \
45 do \
46 { \
47 int slave; \
48 if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) \
49 fd = -1; \
50 else \
51 emacs_close (slave); \
52 } \
53 while (0)
e0f712ba 54
e05aebe9
GM
55/* PTYs only work correctly on Darwin 7 or higher. So make the default
56 for process-connection-type dependent on the kernel version. */
bb4c0e89 57#define MIN_PTY_KERNEL_VERSION '7'
a15252fd 58
e0f712ba
AC
59/* Avoid the use of the name init_process (process.c) because it is
60 also the name of a Mach system call. */
61#define init_process emacs_init_process
62
e0f712ba 63/* Definitions for how to compile & link. */
edfda783 64#ifdef HAVE_NS
edfda783 65#define SYSTEM_PURESIZE_EXTRA 200000
eb21eab5 66#endif
640a0770 67
b1f52161 68#ifdef emacs
14145fa3
AR
69#define malloc unexec_malloc
70#define realloc unexec_realloc
71#define free unexec_free
e05aebe9 72/* Don't use posix_memalign because it is not compatible with unexmacosx.c. */
890617cb 73#undef HAVE_POSIX_MEMALIGN
14145fa3
AR
74#endif
75
511ca371
AC
76/* The following solves the problem that Emacs hangs when evaluating
77 (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile
69955d31
YM
78 does not exist. Also, setsid is not allowed in the vfork child's
79 context as of Darwin 9/Mac OS X 10.5. */
511ca371
AC
80#undef HAVE_WORKING_VFORK
81#define vfork fork