summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-02-27 18:04:00 +0000
committerJim Meyering <jim@meyering.net>2000-02-27 18:04:00 +0000
commit5bea77e1af4b89a68004d57e768b0911a45b560d (patch)
tree392d52b38b67a9ac0c62a3b38426b797d68243ce /lib
parent4fef810c37ba226a2d0437995a3fef9c72fd124c (diff)
downloadcoreutils-5bea77e1af4b89a68004d57e768b0911a45b560d.tar.xz
Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H', not `#if STDC_HEADERS'.
Declare malloc if needed.
Diffstat (limited to 'lib')
-rw-r--r--lib/backupfile.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/backupfile.c b/lib/backupfile.c
index 559b4bd61..100e0a53b 100644
--- 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 *malloc ();
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