Eliminate myrealloc() replacement function
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 4 Jan 2010 11:46:43 +0000 (13:46 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 4 Jan 2010 11:46:43 +0000 (13:46 +0200)
- realloc(NULL, size) is defined as equal to malloc(size) in C99 and
  POSIX 2001, we dont care about anything older than that

configure.ac
misc/Makefile.am
misc/myrealloc.c [deleted file]
rpmio/rpmmalloc.c

index 92001b2..d6da981 100644 (file)
@@ -812,8 +812,6 @@ elif echo "$host_os" | grep sunos > /dev/null; then
        echo "hacking things up for sunos"
        CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
        AC_DEFINE(NEED_STRINGS_H, 1, [Define as one if we need to include <strings.h> (along with <string.h>)])
-       AC_DEFINE(NEED_MYREALLOC, 1, [Define as 1 if we need myrealloc])
-       AC_LIBOBJ(myrealloc)
 fi
 
 #
index eb921ee..b84eea4 100644 (file)
@@ -8,7 +8,7 @@ EXTRA_DIST = \
        fakefork.c      fnmatch.c       fnmatch.h \
        getcwd.c        getmntent.c     \
        getwd.c         glob.c          glob.h          \
-       myrealloc.c     putenv.c        realpath.c      \
+       putenv.c        realpath.c      \
        setenv.c        stpcpy.c        stpncpy.c
 
 noinst_LTLIBRARIES = libmisc.la
diff --git a/misc/myrealloc.c b/misc/myrealloc.c
deleted file mode 100644 (file)
index 1b93c17..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "system.h"
-
-void *myrealloc(void *ptr, size_t size) {
-if (ptr == NULL)
-       return malloc(size);
-   else
-       return realloc(ptr, size);
-}
index 479fe88..fd93cbc 100644 (file)
 
 #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;