ref: 6f6c88bef119fce38cd524f1243eabb548f1287f
parent: 736efd6909fd951f03e1245183e8afc550246ed3
author: Jean-Marc Valin <[email protected]>
date: Tue Aug 31 07:56:09 EDT 2010
_alloca() for Win32
--- a/libcelt/stack_alloc.h
+++ b/libcelt/stack_alloc.h
@@ -97,7 +97,13 @@
#elif defined(USE_ALLOCA)
#define VARDECL(type, var) type *var
-#define ALLOC(var, size, type) var = ((type*)alloca(sizeof(type)*(size)))
+
+# ifdef WIN32
+# define ALLOC(var, size, type) var = ((type*)_alloca(sizeof(type)*(size)))
+# else
+# define ALLOC(var, size, type) var = ((type*)alloca(sizeof(type)*(size)))
+# endif
+
#define SAVE_STACK
#define RESTORE_STACK
#define ALLOC_STACK