forked from GitHub/gf-core
use alloca for compatibility with MSVC
This commit is contained in:
@@ -21,6 +21,12 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <alloca.h>
|
||||
#define alloca _alloca
|
||||
#endif
|
||||
|
||||
|
||||
class PGF_INTERNAL_DECL pgf_error : public std::runtime_error {
|
||||
public:
|
||||
pgf_error(const char *msg) : std::runtime_error(msg)
|
||||
|
||||
@@ -728,7 +728,8 @@ static void add_to_index(ref<PgfConcr> concrete, ref<PgfConcrLin> lin, size_t se
|
||||
throw pgf_error("Found a lin which uses a category without a lincat");
|
||||
|
||||
size_t max_values = 1;
|
||||
size_t ranges[sym_cat->r.n_terms];
|
||||
size_t *ranges = (size_t *)
|
||||
alloca(sym_cat->r.n_terms*sizeof(size_t));
|
||||
for (size_t i = 0; i < sym_cat->r.n_terms; i++) {
|
||||
for (size_t j = 0; j < result->vars->len; j++) {
|
||||
auto var_range = vector_elem(result->vars, j);
|
||||
|
||||
Reference in New Issue
Block a user