cleanup in s/darwin.h, define DARWIN_OS and use it instead of DARWIN and/or MAC_OSX...
authorAdrian Robert <Adrian.B.Robert@gmail.com>
Mon, 4 Aug 2008 14:39:27 +0000 (14:39 +0000)
committerAdrian Robert <Adrian.B.Robert@gmail.com>
Mon, 4 Aug 2008 14:39:27 +0000 (14:39 +0000)
admin/CPP-DEFINES
admin/ChangeLog
src/ChangeLog
src/emacs.c
src/keyboard.h
src/m/intel386.h
src/nsterm.m
src/process.c
src/s/darwin.h
src/sysselect.h

index 564c48e..39243d7 100644 (file)
@@ -14,12 +14,12 @@ DOS_NT              Compiling for either the MS-DOS or native MS-Windows port.
 WINDOWSNT      Compiling the native MS-Windows (W32) port.
 __MINGW32__    Compiling the W32 port with the MinGW port of GCC.
 _MSC_VER       Compiling the W32 port with the Microsoft C compiler.
-USE_LISP_UNION_TYPE Define it in lisp.h to make Lisp_Object be a union type instead of the default int.
+DARWIN_OS      Compiling on Mac OS X or pure Darwin (and using s/darwin.h).
 
 ** Distinguishing GUIs **
 
 HAVE_NTGUI     Use the native W32 GUI for windows, frames, menus&scrollbars.
-HAVE_NS        Use the NeXT/OpenStep/Cocoa UI under Mac OS X or GNUstep.
+HAVE_NS                Use the NeXT/OpenStep/Cocoa UI under Mac OS X or GNUstep.
 NS_IMPL_GNUSTEP        Compile support for GNUSTEP implementation of NS GUI API.
 NS_IMPL_COCOA  Compile support for Cocoa (Apple) implementation of NS GUI API.
 HAVE_X11       Compile support for the X11 GUI.
@@ -48,6 +48,7 @@ PROCATTR        A function that returns attributes of a process.
 REL_ALLOC      Compile in the relocatable memory allocator ralloc.c.
 SYSTEM_MALLOC  Use the system library's malloc.
 subprocesses    System can use subprocesses (for M-x shell for example).  Defined by default, only MSDOS undefines it.
+USE_LISP_UNION_TYPE Define it in lisp.h to make Lisp_Object be a union type instead of the default int.
 
 ** Replace, the definition is trivial: SWITCH_ENUM_CAST
 
index 3507b4e..ce1a7f8 100644 (file)
@@ -1,3 +1,7 @@
+2008-08-04  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+       * CPP_DEFINES: Add DARWIN_OS.  Move USE_LISP_UNION_TYPE away from OS's.
+
 2008-08-02  Eli Zaretskii  <eliz@gnu.org>
 
        * CPP-DEFINES: Add defines for accessing system processes.
index 5504b44..b6ef867 100644 (file)
@@ -1,6 +1,27 @@
+2008-08-04  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+       * emacs.c (main: unexec_init_emacs_zone): Call if on DARWIN_OS.
+
+       * keyboard.h: Comment an #endif.
+
+       * nsterm.m (EmacsView -converstationIdentifier): Use NSInteger
+       version for GNUstep (handled by conditional typedef in nsterm.m).
+       (ns_get_color): Remove special-casing for "darkblue", "dark blue" (now
+       in rgb.txt).
+
+       * process.c (init_process): Use DARWIN_OS, not DARWIN.
+
+       * sysselect.h: Conditionalize init_process undef on DARWIN_OS.
+
+       * m/inter386.h: Change DARWIN to DARWIN_OS.
+
+       * s/darwin.h: Add #define DARWIN_OS.  Get rid of C_SWITCH_SYSTEM def.
+       Change LIBS_MACGUI to LIBS_NSGUI.  Move temacs-conditionalized defs
+       closer to C_SWITCH_SYSTEM_TEMACS so usage is understood.
+
 2008-08-03  Chong Yidong  <cyd@stupidchicken.com>
 
-       * nsterm.m (windowDidResize): Remove stopModel call.
+       * nsterm.m (windowDidResize): Remove stopModal call.
 
 2008-08-03  Andreas Schwab  <schwab@suse.de>
 
index ece0e41..1174f18 100644 (file)
@@ -812,7 +812,8 @@ main (int argc, char **argv)
     run_time_remap (argv[0]);
 #endif
 
-#if defined (NS_IMPL_COCOA)
+/* If using unexmacosx.c (set by s/darwin.h), we must do this. */
+#ifdef DARWIN_OS
   if (!initialized)
     unexec_init_emacs_zone ();
 #endif
index 165901b..efc0546 100644 (file)
@@ -368,7 +368,7 @@ typedef struct _widget_value
 
 extern widget_value *xmalloc_widget_value P_ ((void));
 extern widget_value *digest_single_submenu P_ ((int, int, int));
-#endif
+#endif /* HAVE_NS || HAVE_NTGUI */
 
 \f
 /* Macros for dealing with lispy events.  */
index a897184..e09d842 100644 (file)
@@ -103,7 +103,7 @@ NOTE-END */
 #define SEGMENT_MASK ((SEGMENT_SIZE)-1)
 #endif
 
-#if defined (DARWIN)
+#if defined (DARWIN_OS)
 #ifdef _LP64
 /* For Intel Mac, with CC='gcc -arch x86_64'.  */
 #define NO_ARG_ARRAY
index f8000b9..fd3757b 100644 (file)
@@ -1458,17 +1458,13 @@ ns_get_color (const char *name, NSColor **col)
     NSEnumerator *lenum, *cenum;
     NSString *name;
     NSColorList *clist;
+
 #ifdef NS_IMPL_GNUSTEP
     /* XXX: who is wrong, the requestor or the implementation? */
     if ([nsname compare: @"Highlight" options: NSCaseInsensitiveSearch]
         == NSOrderedSame)
       nsname = @"highlightColor";
 #endif
-    if ([nsname compare: @"dark blue" options: NSCaseInsensitiveSearch]
-        == NSOrderedSame
-      || [nsname compare: @"darkblue" options: NSCaseInsensitiveSearch]
-        == NSOrderedSame)
-      nsname = @"navy blue";
 
     lenum = [[NSColorList availableColorLists] objectEnumerator];
     while ( (clist = [lenum nextObject]) && new == nil)
@@ -4645,17 +4641,10 @@ if (NS_KEYLOG) NSLog (@"firstRectForCharRange request");
   return rect;
 }
 
-#ifdef NS_IMPL_GNUSTEP
-- (long)conversationIdentifier
-{
-  return (long)self;
-}
-#else
 - (NSInteger)conversationIdentifier
 {
   return (NSInteger)self;
 }
-#endif
 
 /* TODO: below here not yet implemented correctly, but may not be needed */
 
index cb7d2c2..b82fb9f 100644 (file)
@@ -7611,7 +7611,7 @@ init_process ()
  }
 #endif /* HAVE_SOCKETS */
 
-#if defined (DARWIN)
+#if defined (DARWIN_OS)
   /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive
      processes.  As such, we only change the default value.  */
  if (initialized)
index 42406a4..e71eb15 100644 (file)
@@ -27,6 +27,14 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* BSD4_3 and BSD4_4 are already defined in sys/param.h */
 #define BSD_SYSTEM
 
+/* More specific than the above two.  We cannot use __APPLE__ as this
+   may not be defined on non-OSX Darwin, and we cannot define DARWIN
+   here because Panther and lower CoreFoundation.h uses DARWIN to
+   distinguish OS X from pure Darwin. */
+
+#define DARWIN_OS
+
+
 /* SYSTEM_TYPE should indicate the kind of system you are using.
  It sets the Lisp variable system-type.  */
 
@@ -127,7 +135,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* This seems to help in Ctrl-G detection under Cocoa, however at the cost
    of some quirks that may or may not bother a given user. */
-#if defined (COCOA_EXPERIMENTAL_CTRL_G)
+#ifdef COCOA_EXPERIMENTAL_CTRL_G
 #define NO_SOCK_SIGIO
 #endif
 
@@ -142,35 +150,33 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Definitions for how to compile & link.  */
 
-/* Link in the AppKit lib. */
 #ifdef HAVE_NS
-/* PENDING: can this target be specified in a clearer way? */
 #define OTHER_FILES ns-app
 /* XXX: lresolv is here because configure when testing #undefs res_init,
         a macro in /usr/include/resolv.h for res_9_init, not in stdc lib. */
-#define LIBS_MACGUI -framework AppKit -lresolv
+#define LIBS_NSGUI -framework AppKit -lresolv
 #define SYSTEM_PURESIZE_EXTRA 200000
 #define HEADERPAD_EXTRA 6C8
+
 #else /* !HAVE_NS */
+#define LIBS_NSGUI
 #define HEADERPAD_EXTRA 690
-
-/* FIXME: Is this needed?
-   This is for the Carbon port.  Under the NeXTstep port, this is still picked
-   up during preprocessing, but is undone in config.in. */
-#define C_SWITCH_SYSTEM -fpascal-strings -DMAC_OSX
-
-#define LIBS_MACGUI
-
 #endif /* !HAVE_NS */
 
 /* 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); under Cocoa 31 commands are required.  */
-#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_MACGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA
+#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA
 
 #define C_SWITCH_SYSTEM_TEMACS -Dtemacs
 
+#ifdef temacs
+#define malloc unexec_malloc
+#define realloc unexec_realloc
+#define free unexec_free
+#endif
+
 /* The ncurses library has been moved out of the System framework in
    Mac OS X 10.2.  So if ./configure detects it, set the command-line
    option to use it.  */
@@ -211,12 +217,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    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
index 7a8a185..c6d483b 100644 (file)
@@ -18,11 +18,11 @@ You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifdef HAVE_SYS_SELECT_H
-#if defined (DARWIN) || defined (NS_IMPL_COCOA)
+#if defined (DARWIN_OS)
 #undef init_process
 #endif
 #include <sys/select.h>
-#if defined (DARWIN) || defined (NS_IMPL_COCOA)
+#if defined (DARWIN_OS)
 #define init_process emacs_init_process
 #endif
 #endif