From 3349946ab21ed3d90a3e5600a8f8719bd0cb02e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 3 May 2011 13:39:38 +0200 Subject: [PATCH] common: mem.h add alloca definition We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day, someone cares for a weird platform, he can fix it. --- common/mem.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/common/mem.h b/common/mem.h index 8ba6586..980ea13 100644 --- a/common/mem.h +++ b/common/mem.h @@ -22,10 +22,40 @@ #include #include +#ifdef HAVE_CONFIG_H +# include +#endif + #ifdef __cplusplus extern "C" { #endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# ifndef HAVE_ALLOCA +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + typedef struct SpiceChunk { uint8_t *data; uint32_t len;