From d9332d4a7d9fb6b87568b0fb82fdaeb06ceddd63 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Mon, 6 Mar 2017 12:36:34 +0100 Subject: [PATCH] configure: check for AC_FUNC_ALLOCA Add AC_FUNC_ALLOCA and adjust src/i965_decoder_utils.c to properly include relevant header files for alloca(3). Some operating systems does not have (e.g. NetBSD). This fixes compilation on such systems. --- configure.ac | 1 + src/i965_decoder_utils.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1612993..0ceac64 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,7 @@ AC_PROG_CXX AC_C_BIGENDIAN AC_HEADER_STDC AC_SYS_LARGEFILE +AC_FUNC_ALLOCA AC_CHECK_LIB([m], [sin]) AC_CHECK_FUNCS([log2f]) AC_CHECK_PROGS([PYTHON2], [python2 python]) diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c index 640fd14..a467aee 100644 --- a/src/i965_decoder_utils.c +++ b/src/i965_decoder_utils.c @@ -23,7 +23,17 @@ #include "sysdeps.h" #include -#include +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_ALLOCA_H +# include +#endif #include "intel_batchbuffer.h" #include "intel_media.h" -- 2.12.0