From b4b4b9436740997a807f59e0c979520ed4d20311 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 15 Feb 2018 01:59:17 +0000 Subject: [PATCH] gc.c: force STACK_GROW_DIRECTION for emscripten The configure script fails to guess the direction on emscripten. Perhaps this is because of https://github.com/kripken/emscripten/issues/2093 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gc.c b/gc.c index a1e6bc4bc2..ad4cd55b2a 100644 --- a/gc.c +++ b/gc.c @@ -3996,6 +3996,11 @@ init_mark_stack(mark_stack_t *stack) #define STACK_END (ec->machine.stack_end) #define STACK_LEVEL_MAX (ec->machine.stack_maxsize/sizeof(VALUE)) +#ifdef __EMSCRIPTEN__ +#undef STACK_GROW_DIRECTION +#define STACK_GROW_DIRECTION 1 +#endif + #if STACK_GROW_DIRECTION < 0 # define STACK_LENGTH (size_t)(STACK_START - STACK_END) #elif STACK_GROW_DIRECTION > 0