From da9200fcee8756b510083ca5434da87fc6512f28 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Lacaze Date: Mon, 9 Jan 2012 10:19:09 +0100 Subject: [PATCH] Fix alloca use on mingw. --- opt.cpp | 4 +++- util.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opt.cpp b/opt.cpp index c50f5f06..c66c69b1 100644 --- a/opt.cpp +++ b/opt.cpp @@ -79,7 +79,9 @@ #include #elif defined(ISPC_IS_WINDOWS) #include - #define alloca _alloca + #ifndef __MINGW32__ + #define alloca _alloca + #endif #endif // ISPC_IS_WINDOWS static llvm::Pass *CreateIntrinsicsOptPass(); diff --git a/util.cpp b/util.cpp index f0d89c0d..34798a35 100644 --- a/util.cpp +++ b/util.cpp @@ -39,6 +39,9 @@ #include "module.h" #ifdef ISPC_IS_WINDOWS #include +#ifdef __MINGW32__ +#include // for alloca() +#endif #else #include #endif