]> code.delx.au - gnu-emacs/blobdiff - src/unexmacosx.c
(xic_create_xfontset): Fix previous change.
[gnu-emacs] / src / unexmacosx.c
index 43e1f5e805cb53942ab5540f90c712b43460f050..f65fd9cbc221e32eaa43a7555bff6f7cc45aaef3 100644 (file)
@@ -1,5 +1,6 @@
 /* Dump Emacs in Mach-O format for use on Mac OS X.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005,
+                 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -99,7 +100,11 @@ Boston, MA 02110-1301, USA.  */
 #if defined (__ppc__)
 #include <mach-o/ppc/reloc.h>
 #endif
-#if defined (HAVE_MALLOC_MALLOC_H)
+#include <config.h>
+#undef malloc
+#undef realloc
+#undef free
+#ifdef HAVE_MALLOC_MALLOC_H
 #include <malloc/malloc.h>
 #else
 #include <objc/malloc.h>
@@ -557,7 +562,7 @@ print_load_command (struct load_command *lc)
 static void
 read_load_commands ()
 {
-  int n, i, j;
+  int i;
 
   if (!unexec_read (&mh, sizeof (struct mach_header)))
     unexec_error ("cannot read mach-o header");
@@ -679,7 +684,6 @@ copy_data_segment (struct load_command *lc)
   struct section *sectp;
   int j;
   unsigned long header_offset, file_offset, old_file_offset;
-  struct region_t *r;
 
   printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
          scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
@@ -1017,6 +1021,9 @@ void
 unexec (char *outfile, char *infile, void *start_data, void *start_bss,
         void *entry_address)
 {
+  if (in_dumped_exec)
+    unexec_error ("Unexec from a dumped executable is not supported.");
+
   infd = open (infile, O_RDONLY, 0);
   if (infd < 0)
     {