diff src/unexmacosx.c @ 112385:5bc690b4522f

* src/unexmacosx.c: Add comment about include order.
author Jan D. <jan.h.d@swipnet.se>
date Thu, 20 Jan 2011 07:43:04 +0100
parents 1a3d4c7ba327
children
line wrap: on
line diff
--- a/src/unexmacosx.c	Wed Jan 19 22:40:36 2011 -0800
+++ b/src/unexmacosx.c	Thu Jan 20 07:43:04 2011 +0100
@@ -86,15 +86,20 @@
    be changed accordingly.
 */
 
-#include <stdio.h>
+/* config.h #define:s malloc/realloc/free and then includes stdlib.h.
+   We want the undefined versions, but if config.h includes stdlib.h
+   with the #define:s in place, the prototypes will be wrong and we get
+   warnings.  To prevent that, include stdlib.h before config.h.  */
+
 #include <stdlib.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <sys/types.h>
 #include <config.h>
 #undef malloc
 #undef realloc
 #undef free
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <mach/mach.h>
 #include <mach-o/loader.h>