mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
use alloca for compatibility with MSVC
This commit is contained in:
@@ -21,6 +21,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include <alloca.h>
|
||||||
|
#define alloca _alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class PGF_INTERNAL_DECL pgf_error : public std::runtime_error {
|
class PGF_INTERNAL_DECL pgf_error : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
pgf_error(const char *msg) : std::runtime_error(msg)
|
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");
|
throw pgf_error("Found a lin which uses a category without a lincat");
|
||||||
|
|
||||||
size_t max_values = 1;
|
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 i = 0; i < sym_cat->r.n_terms; i++) {
|
||||||
for (size_t j = 0; j < result->vars->len; j++) {
|
for (size_t j = 0; j < result->vars->len; j++) {
|
||||||
auto var_range = vector_elem(result->vars, j);
|
auto var_range = vector_elem(result->vars, j);
|
||||||
|
|||||||
Reference in New Issue
Block a user