From 5e4c74dfd5927b3829b4f5e04a7964dbac6a4f34 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 31 Dec 2018 06:44:45 -0800 Subject: Eliminate ALLOCA_H. * configure: Instead of generating a definition of ALLOCA_H, generate the variable HAVE_ALLOCA_ with a value of 1, where is one of stdlib, alloca or malloc. * alloca.h: New header. * args.c, eval.c, ffi.c ffi.c, ftw.c, hash.c, lib.c, match.c, parser.c, parser.y, regex.c, socket.c, stream.c, struct.c, sysif.c, syslog.c, termios.c, unwind.c, vm.c: Include "alloca.h" instead of ALLOCA_H. --- args.c | 2 +- configure | 6 +++--- eval.c | 2 +- ffi.c | 2 +- ftw.c | 2 +- hash.c | 2 +- lib.c | 2 +- match.c | 2 +- parser.c | 2 +- parser.y | 2 +- regex.c | 2 +- socket.c | 2 +- stream.c | 2 +- struct.c | 2 +- sysif.c | 2 +- syslog.c | 2 +- termios.c | 4 ++-- unwind.c | 2 +- vm.c | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) diff --git a/args.c b/args.c index c93d8108..88b59f5b 100644 --- a/args.c +++ b/args.c @@ -30,7 +30,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "signal.h" #include "unwind.h" diff --git a/configure b/configure index 7e99d64d..ba70c550 100755 --- a/configure +++ b/configure @@ -2577,9 +2577,9 @@ done printf "Checking for alloca ... " -for try_header in stdlib.h alloca.h malloc.h ; do +for try_header in stdlib alloca malloc ; do cat > conftest.c < +#include <$try_header.h> int main(int argc, char **argv) { @@ -2590,7 +2590,7 @@ int main(int argc, char **argv) if conftest ; then printf "yes\n" - printf "#define ALLOCA_H <%s>\n" $try_header >> config.h + printf "#define HAVE_ALLOCA_%s 1\n" $try_header >> config.h have_alloca=y break; fi diff --git a/eval.c b/eval.c index 2cf3e36e..6ee34e7f 100644 --- a/eval.c +++ b/eval.c @@ -34,7 +34,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "gc.h" #include "args.h" diff --git a/ffi.c b/ffi.c index 7bf5cad8..9f07ad27 100644 --- a/ffi.c +++ b/ffi.c @@ -43,7 +43,7 @@ #if HAVE_SYS_TYPES_H #include #endif -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "stream.h" #include "gc.h" diff --git a/ftw.c b/ftw.c index 22b857e3..90cf6820 100644 --- a/ftw.c +++ b/ftw.c @@ -32,7 +32,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "gc.h" #include "args.h" diff --git a/hash.c b/hash.c index c5344c69..b77bb092 100644 --- a/hash.c +++ b/hash.c @@ -32,7 +32,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #if HAVE_UNISTD_H #include #endif diff --git a/lib.c b/lib.c index 0c20f912..b0137a68 100644 --- a/lib.c +++ b/lib.c @@ -40,7 +40,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #ifdef HAVE_GETENVIRONMENTSTRINGS #define NOMINMAX #include diff --git a/match.c b/match.c index c55daaef..488d4770 100644 --- a/match.c +++ b/match.c @@ -32,7 +32,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "gc.h" #include "args.h" diff --git a/parser.c b/parser.c index 9271f03a..ebb5d9b9 100644 --- a/parser.c +++ b/parser.c @@ -37,7 +37,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #ifdef __CYGWIN__ #include #endif diff --git a/parser.y b/parser.y index 54caed43..9b582b2f 100644 --- a/parser.y +++ b/parser.y @@ -38,7 +38,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "signal.h" #include "unwind.h" diff --git a/regex.c b/regex.c index 0ce9cf7a..86e40784 100644 --- a/regex.c +++ b/regex.c @@ -34,7 +34,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "parser.h" #include "signal.h" diff --git a/socket.c b/socket.c index 97c7b690..441475ce 100644 --- a/socket.c +++ b/socket.c @@ -38,7 +38,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #if HAVE_SYS_SELECT_H #include #endif diff --git a/stream.c b/stream.c index 522c5df1..2a5dc223 100644 --- a/stream.c +++ b/stream.c @@ -56,7 +56,7 @@ #if HAVE_SOCKETS #include #endif -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "gc.h" #include "signal.h" diff --git a/struct.c b/struct.c index dbff36a1..dedc09e6 100644 --- a/struct.c +++ b/struct.c @@ -34,7 +34,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "hash.h" #include "eval.h" diff --git a/sysif.c b/sysif.c index 5ba65ebf..365c77cb 100644 --- a/sysif.c +++ b/sysif.c @@ -76,7 +76,7 @@ #if HAVE_DLOPEN #include #endif -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "stream.h" #include "hash.h" diff --git a/syslog.c b/syslog.c index cd2e8ca8..bb6d797d 100644 --- a/syslog.c +++ b/syslog.c @@ -33,7 +33,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "stream.h" #include "gc.h" diff --git a/termios.c b/termios.c index ce2ed01a..f4d69a82 100644 --- a/termios.c +++ b/termios.c @@ -33,9 +33,9 @@ #include #include #include -#include "config.h" #include -#include ALLOCA_H +#include "config.h" +#include "alloca.h" #include "lib.h" #include "gc.h" #include "args.h" diff --git a/unwind.c b/unwind.c index 34ce8792..213e2119 100644 --- a/unwind.c +++ b/unwind.c @@ -45,7 +45,7 @@ #include "eval.h" #include "struct.h" #include "cadr.h" -#include ALLOCA_H +#include "alloca.h" #include "unwind.h" #define UW_CONT_FRAME_BEFORE (32 * sizeof (val)) diff --git a/vm.c b/vm.c index 6aeaee96..67ccc1bb 100644 --- a/vm.c +++ b/vm.c @@ -34,7 +34,7 @@ #include #include #include "config.h" -#include ALLOCA_H +#include "alloca.h" #include "lib.h" #include "eval.h" #include "signal.h" -- cgit v1.2.3