changeset 2294:32a3de088d60

Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H', not `#if STDC_HEADERS'. Declare malloc if needed.
author Jim Meyering <jim@meyering.net>
date Sun, 27 Feb 2000 18:04:00 +0000
parents d68da7d92089
children 1577fef29121
files lib/backupfile.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lib/backupfile.c
+++ b/lib/backupfile.c
@@ -58,10 +58,8 @@
 # define CLOSEDIR(d) closedir (d)
 #endif
 
-#if STDC_HEADERS
+#if HAVE_STDLIB_H
 # include <stdlib.h>
-#else
-char *malloc ();
 #endif
 
 #ifndef HAVE_DECL_GETENV
@@ -71,6 +69,13 @@
 char *getenv ();
 #endif
 
+#ifndef HAVE_DECL_MALLOC
+"this configure-time declaration test was not run"
+#endif
+#if !HAVE_DECL_MALLOC
+char *malloc ();
+#endif
+
 char *base_name PARAMS ((char const *));
 
 #if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H