From bbed26b303fd4bd9515d0e74f78d4334685a4680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Tue, 28 Oct 2014 15:41:35 +0100 Subject: [PATCH] check for alloca.h before including --- configure.ac | 3 +++ src/psl.c | 4 +++- src/psl2c.c | 3 +++ tests/test-is-cookie-domain-acceptable.c | 4 +++- tests/test-is-public-all.c | 4 +++- tests/test-is-public-builtin.c | 4 +++- tests/test-is-public.c | 4 +++- tests/test-registrable-domain.c | 4 +++- 8 files changed, 24 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 4a37ede..bad1b4d 100644 --- a/configure.ac +++ b/configure.ac @@ -205,6 +205,9 @@ AC_ARG_WITH(psl-testfile, PSL_TESTFILE="\$(top_srcdir)/data/test_psl.txt") AC_SUBST(PSL_TESTFILE) +# check for alloca / alloca.h +AC_FUNC_ALLOCA + # Override the template file name of the generated .pc file, so that there # is no need to rename the template file when the API version changes. AC_CONFIG_FILES([Makefile diff --git a/src/psl.c b/src/psl.c index 49054f2..a4bc01b 100644 --- a/src/psl.c +++ b/src/psl.c @@ -63,10 +63,12 @@ #include #include #include -#include #include #include #include +#ifdef HAVE_ALLOCA_H +# include +#endif #ifdef WITH_LIBICU # include diff --git a/src/psl2c.c b/src/psl2c.c index 0f2e066..a31a2cd 100644 --- a/src/psl2c.c +++ b/src/psl2c.c @@ -38,6 +38,9 @@ #include #include #include +#ifdef HAVE_ALLOCA_H +# include +#endif #if defined(BUILTIN_GENERATOR_LIBICU) || defined(BUILTIN_GENERATOR_LIBIDN2) || defined(BUILTIN_GENERATOR_LIBIDN) # define _GENERATE_BUILTIN_DATA diff --git a/tests/test-is-cookie-domain-acceptable.c b/tests/test-is-cookie-domain-acceptable.c index dd1f934..f5c9ae5 100644 --- a/tests/test-is-cookie-domain-acceptable.c +++ b/tests/test-is-cookie-domain-acceptable.c @@ -35,7 +35,9 @@ #include #include #include -#include +#ifdef HAVE_ALLOCA_H +# include +#endif #include diff --git a/tests/test-is-public-all.c b/tests/test-is-public-all.c index 5889642..743004c 100644 --- a/tests/test-is-public-all.c +++ b/tests/test-is-public-all.c @@ -36,7 +36,9 @@ #include #include #include -#include +#ifdef HAVE_ALLOCA_H +# include +#endif #include diff --git a/tests/test-is-public-builtin.c b/tests/test-is-public-builtin.c index 2ccde36..d3c2d44 100644 --- a/tests/test-is-public-builtin.c +++ b/tests/test-is-public-builtin.c @@ -35,7 +35,9 @@ #include #include #include -#include +#ifdef HAVE_ALLOCA_H +# include +#endif #include diff --git a/tests/test-is-public.c b/tests/test-is-public.c index 0afbdd7..828c946 100644 --- a/tests/test-is-public.c +++ b/tests/test-is-public.c @@ -35,7 +35,9 @@ #include #include #include -#include +#ifdef HAVE_ALLOCA_H +# include +#endif #include diff --git a/tests/test-registrable-domain.c b/tests/test-registrable-domain.c index 8bc06b1..1d4b68d 100644 --- a/tests/test-registrable-domain.c +++ b/tests/test-registrable-domain.c @@ -36,7 +36,9 @@ #include #include #include -#include +#ifdef HAVE_ALLOCA_H +# include +#endif #ifdef WITH_LIBICU # include