Move malloc portability tweaks out of system.h
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Dec 2009 10:55:45 +0000 (12:55 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 23 Dec 2009 10:55:45 +0000 (12:55 +0200)
- only rpmmalloc.c needs, no need to pollute system.h

rpmio/rpmmalloc.c
system.h

index 5a71834..479fe88 100644 (file)
@@ -3,8 +3,18 @@
  */
 
 #include "system.h"
+
+#if HAVE_MALLOC_H 
+#include <malloc.h>
+#endif
+
 #include "debug.h"
 
+#if NEED_MYREALLOC
+#define realloc(ptr,size) myrealloc(ptr,size)
+extern void *myrealloc(void *, size_t);
+#endif
+
 static rpmMemFailFunc failfunc = NULL;
 static void *failfunc_data = NULL;
 
index e9ba13a..43e70c9 100644 (file)
--- a/system.h
+++ b/system.h
@@ -189,10 +189,6 @@ char *realpath(const char *path, char resolved_path []);
 #include <err.h>
 #endif
 
-#if HAVE_MALLOC_H 
-#include <malloc.h>
-#endif
-
 #if WITH_SELINUX
 #include <selinux/selinux.h>
 #else
@@ -319,11 +315,6 @@ extern const char *__progname;
 #include <strings.h>
 #endif
 
-#if NEED_MYREALLOC
-#define realloc(ptr,size) myrealloc(ptr,size)
-extern void *myrealloc(void *, size_t);
-#endif
-
 #if ! HAVE_SETENV
 extern int setenv(const char *name, const char *value, int replace);
 extern void unsetenv(const char *name);