changeset 69966:de28ca2dd3c3

Include config.h before using HAVE_MALLOC_MALLOC_H. (malloc, realloc, free): Add undefs. (read_load_commands): Remove unused variable `n' and `j'. (copy_data_segment): Remove unused variable `r'.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 12 Apr 2006 08:10:07 +0000
parents e8a7cef5ffb5
children 38a999288ac4
files src/unexmacosx.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/unexmacosx.c	Wed Apr 12 08:09:44 2006 +0000
+++ b/src/unexmacosx.c	Wed Apr 12 08:10:07 2006 +0000
@@ -100,7 +100,11 @@
 #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>
@@ -558,7 +562,7 @@
 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");
@@ -680,7 +684,6 @@
   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,