diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-05-03 13:39:38 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-03-20 15:25:52 +0100 |
commit | 3349946ab21ed3d90a3e5600a8f8719bd0cb02e0 (patch) | |
tree | 2beb8fec21ce7704410884947bad03e11e0c73ff /common/mem.h | |
parent | 55e936b9fd3c3796c89342d2fa98998d81f621d5 (diff) | |
download | spice-common-3349946ab21ed3d90a3e5600a8f8719bd0cb02e0.tar.gz spice-common-3349946ab21ed3d90a3e5600a8f8719bd0cb02e0.tar.xz spice-common-3349946ab21ed3d90a3e5600a8f8719bd0cb02e0.zip |
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.
Diffstat (limited to 'common/mem.h')
-rw-r--r-- | common/mem.h | 30 |
1 files changed, 30 insertions, 0 deletions
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 <stdlib.h> #include <spice/macros.h> +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #ifdef __cplusplus extern "C" { #endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_ALLOCA_H +# include <alloca.h> +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include <malloc.h> +# 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; |