diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index a04bf1b9..85aad292 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -21,22 +21,24 @@ # include #endif -#if HAVE_ALLOCA_H -# include -#elif !defined(alloca) -# if defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined _AIX -# define alloca __alloca -# elif defined _MSC_VER -# include -# define alloca _alloca -# else -# include -# ifdef __cplusplus +#ifndef HAVE_C_VARARRAYS +# ifdef HAVE_ALLOCA_H +# include +# elif !defined(alloca) +# if defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# else +# include +# ifdef __cplusplus extern "C" -# endif +# endif void *alloca (size_t); +# endif # endif #endif @@ -128,11 +130,11 @@ sodium_memzero(void *const pnt, const size_t len) void sodium_stackzero(const size_t len) { -#ifdef HAVE_ALLOCA - sodium_memzero(alloca(len), len); -#elif HAVE_C_VARARRAYS +#ifdef HAVE_C_VARARRAYS unsigned char fodder[len]; sodium_memzero(fodder, len); +#elif HAVE_ALLOCA + sodium_memzero(alloca(len), len); #endif }