mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-11-04 03:15:26 -07:00
use alloca for compatibility with MSVC
This commit is contained in:
1 parent
ee96bcbb1c
commit
b138d0c89b
2 files changed
+8
-1
No files matched your search
@@ -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