From 47a93f77a5ec7f3515a06e91218626f01312c702 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 15 Sep 1997 03:20:53 +0000 Subject: [PATCH] . --- lib/Makefile.in | 24 ++++++++++++------------ m4/Makefile.in | 4 ++-- m4/realloc.m4 | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 m4/realloc.m4 diff --git a/lib/Makefile.in b/lib/Makefile.in index 8d6a16072..ca5363885 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -135,10 +135,10 @@ HEADERS = $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in alloca.c chown.c error.c error.h \ euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \ getgroups.c getline.c group-member.c lstat.c memcmp.c memcpy.c memset.c \ -mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c regex.c \ -regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c stpncpy.c \ -strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c strtoul.c \ -strverscmp.c ylwrap +mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c realloc.c \ +regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c \ +stpncpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \ +strtoul.c strverscmp.c ylwrap DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -154,14 +154,14 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \ .deps/long-options.P .deps/lstat.P .deps/makepath.P .deps/memcmp.P \ .deps/memcpy.P .deps/memset.P .deps/mkdir.P .deps/mktime.P \ .deps/modechange.P .deps/mountlist.P .deps/oa-hash.P .deps/obstack.P \ -.deps/path-concat.P .deps/posixtm.P .deps/regex.P .deps/rename.P \ -.deps/rmdir.P .deps/rpmatch.P .deps/rx.P .deps/safe-read.P \ -.deps/save-cwd.P .deps/savedir.P .deps/stat.P .deps/stpcpy.P \ -.deps/stpncpy.P .deps/strcasecmp.P .deps/strdup.P .deps/strftime.P \ -.deps/stripslash.P .deps/strndup.P .deps/strstr.P .deps/strtol.P \ -.deps/strtoul.P .deps/strverscmp.P .deps/userspec.P .deps/xgetcwd.P \ -.deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P .deps/xstrtoul.P \ -.deps/yesno.P +.deps/path-concat.P .deps/posixtm.P .deps/realloc.P .deps/regex.P \ +.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \ +.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \ +.deps/stpcpy.P .deps/stpncpy.P .deps/strcasecmp.P .deps/strdup.P \ +.deps/strftime.P .deps/stripslash.P .deps/strndup.P .deps/strstr.P \ +.deps/strtol.P .deps/strtoul.P .deps/strverscmp.P .deps/userspec.P \ +.deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P \ +.deps/xstrtoul.P .deps/yesno.P SOURCES = $(libfu_a_SOURCES) OBJECTS = $(libfu_a_OBJECTS) diff --git a/m4/Makefile.in b/m4/Makefile.in index 67eabf07d..163adbb12 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -94,8 +94,8 @@ l = @l@ EXTRA_DIST = README \ chown.m4 d-ino.m4 d-type.m4 getgroups.m4 getline.m4 getloadavg.m4 \ -jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lstat.m4 memcmp.m4 putenv.m4 \ -stat.m4 strftime.m4 uptime.m4 +jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lstat.m4 memcmp.m4 realloc.m4 \ +putenv.m4 stat.m4 strftime.m4 uptime.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/m4/realloc.m4 b/m4/realloc.m4 new file mode 100644 index 000000000..b4afe939d --- /dev/null +++ b/m4/realloc.m4 @@ -0,0 +1,33 @@ +#serial 1 + +dnl From Jim Meyering. +dnl Determine whether realloc accepts 0 as its first argument. +dnl If it doesn't, arrange to use the replacement function. +dnl +dnl If you use this macro in a package, you should +dnl add the following two lines to acconfig.h: +dnl /* Define to rpl_realloc if the replacement function should be used. */ +dnl #undef realloc +dnl + +AC_DEFUN(jm_FUNC_REALLOC, +[ + AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, + [AC_TRY_RUN([ + char *realloc (); + int + main () + { + exit (realloc (0, 1) ? 0 : 1); + } + ], + jm_cv_func_working_realloc=yes, + jm_cv_func_working_realloc=no, + dnl When crosscompiling, assume realloc is broken. + jm_cv_func_working_realloc=no) + ]) + if test $jm_cv_func_working_realloc = no; then + LIBOBJS="$LIBOBJS realloc.o" + AC_DEFINE_UNQUOTED(realloc, rpl_realloc) + fi +]) -- 2.11.0