X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/09740ad8a9c82b51464d3f718daf1f9fc3779a99..d0a29e1de77e4c1c01c46d80b6ac2df06b1df2b3:/src/s/darwin.h diff --git a/src/s/darwin.h b/src/s/darwin.h index 59f63f5718..91975cd441 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -1,5 +1,6 @@ /* System description header file for Darwin (Mac OS X). - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -15,8 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ /* @@ -37,11 +38,20 @@ Boston, MA 02111-1307, USA. */ #define BSD_SYSTEM /* #define VMS */ +#if 0 /* Don't define DARWIN on Mac OS X because CoreFoundation.h uses + it to distinguish Mac OS X from bare Darwin. */ +#ifndef DARWIN +#define DARWIN 1 +#endif +#endif + /* MAC_OS is used to conditionally compile code common to both MAC_OS8 and MAC_OSX. */ #ifdef MAC_OSX +#ifdef HAVE_CARBON #define MAC_OS #endif +#endif /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ @@ -101,10 +111,18 @@ Boston, MA 02111-1307, USA. */ /* * Define HAVE_PTYS if the system supports pty devices. + * Note: PTYs are broken on darwin <6. Use at your own risk. */ #define HAVE_PTYS +/** + * PTYs only work correctly on Darwin 7 or higher. So make the + * default for process-connection-type dependent on the kernel + * version. + */ +#define MIN_PTY_KERNEL_VERSION '7' + /* * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate * The 4.2 opendir, etc., library functions. @@ -176,7 +194,7 @@ Boston, MA 02111-1307, USA. */ /* If the system's imake configuration file defines `NeedWidePrototypes' as `NO', we must define NARROWPROTO manually. Such a define is - generated in the Makefile generated by `xmkmf'. If we don't + generated in the Makefile generated by `xmkmf'. If we don't define NARROWPROTO, we will see the wrong function prototypes for X functions taking float or double parameters. */ @@ -201,15 +219,9 @@ Boston, MA 02111-1307, USA. */ /* Fix compilation problem for regex.c. */ #define __restrict -/* Fix compilation problem for md5.c. */ -#define __attribute__(x) - /* Used in dispnew.c. Copied from freebsd.h. */ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -/* Darwin provides POSIX-style getpgrp. */ -#define GETPGRP_NO_ARG - /* System uses OXTABS instead of the expected TAB3. (Copied from bsd386.h.) */ #define TAB3 OXTABS @@ -221,8 +233,17 @@ Boston, MA 02111-1307, USA. */ /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ #define HAVE_SOCKETS +/* In Carbon, asynchronous I/O (using SIGIO) can't be used for window + events because they don't come from sockets, even though it works + fine on tty's. */ +#ifdef HAVE_CARBON +#define NO_SOCK_SIGIO +#endif + /* Extra initialization calls in main for Mac OS X system type. */ +#ifdef HAVE_CARBON #define SYMS_SYSTEM syms_of_mac() +#endif /* Definitions for how to dump. Copied from nextstep.h. */ @@ -243,13 +264,20 @@ Boston, MA 02111-1307, USA. */ /* Indicate that we are compiling for Mac OS X and where to find Mac specific headers. */ -#define C_SWITCH_SYSTEM -fpascal-strings -fno-common -DMAC_OSX -I../mac/src +#define C_SWITCH_SYSTEM -fpascal-strings -DMAC_OSX -I../mac/src + +/* Link in the Carbon lib. */ +#ifdef HAVE_CARBON +#define LIBS_CARBON -framework Carbon -framework QuickTime +#else +#define LIBS_CARBON +#endif -/* Link in the Carbon lib. The -headerpad option tells ld (see man - page) to leave room at the end of the header for adding load - commands. Needed for dumping. 0x690 is the total size of 30 - segment load commands (at 56 each). */ -#define LD_SWITCH_SYSTEM_TEMACS -prebind -framework Carbon -lstdc++ -Xlinker -headerpad -Xlinker 690 +/* The -headerpad option tells ld (see man page) to leave room at the + end of the header for adding load commands. Needed for dumping. + 0x690 is the total size of 30 segment load commands (at 56 + each). */ +#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON -Xlinker -headerpad -Xlinker 690 #define C_SWITCH_SYSTEM_TEMACS -Dtemacs @@ -258,6 +286,9 @@ Boston, MA 02111-1307, USA. */ option to use it. */ #ifdef HAVE_LIBNCURSES #define LIBS_TERMCAP -lncurses +/* This prevents crashes when running Emacs in Terminal.app under + 10.2. */ +#define TERMINFO #endif /* Link this program just by running cc. */ @@ -271,7 +302,9 @@ Boston, MA 02111-1307, USA. */ /* Tell src/Makefile.in to create files in the Mac OS X application bundle mac/Emacs.app. */ +#ifdef HAVE_CARBON #define OTHER_FILES macosx-app +#endif /* Define the following so emacs symbols will not conflict with those @@ -291,14 +324,37 @@ Boston, MA 02111-1307, USA. */ struct kboard; #endif +/* The following solves the problem that Emacs hangs when evaluating + (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile + does not exist. */ +#undef HAVE_WORKING_VFORK +#define vfork fork -/* This makes create_process in process.c save and restore signal - handlers correctly. Suggested by Nozomu Ando.*/ -#define POSIX_SIGNALS - +/* Don't close pty in process.c to make it as controlling terminal. + It is already a controlling terminal of subprocess, because we did + ioctl TIOCSCTTY. */ +#define DONT_REOPEN_PTY #ifdef temacs #define malloc unexec_malloc #define realloc unexec_realloc #define free unexec_free #endif + +/* This makes create_process in process.c save and restore signal + handlers correctly. Suggested by Nozomu Ando.*/ +#define POSIX_SIGNALS + +/* Reroute calls to SELECT to the version defined in mac.c to fix the + problem of Emacs requiring an extra return to be typed to start + working when started from the command line. */ +#if defined (HAVE_CARBON) && (defined (emacs) || defined (temacs)) +#define select sys_select +#endif + +/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the + stack. */ +#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS + +/* arch-tag: 481d443d-4f89-43ea-b5fb-49706d95fa41 + (do not change this comment) */