Added comments about removal of objects[]
Made mrb_get_args_v() static
MODIFY
include/mruby/gc.h
include/mruby/gc.h
@@ -48,6 +48,8 @@ typedef struct mrb_heap_page {
struct mrb_heap_page *free_next;
struct mrb_heap_page *free_prev;
mrb_bool old:1;
+ /* Flexible array members area a C99 feature, not C++ compatible */
+ /* void* objects[]; */
} mrb_heap_page;
#ifdef _MSC_VER

MODIFY
src/class.c
src/class.c
@@ -869,7 +869,7 @@ mrb_block_given_p(mrb_state *mrb)
return !mrb_nil_p(b);
}
-mrb_int mrb_get_args_v(mrb_state *mrb, mrb_args_format format, void** ptr, va_list ap);
+static mrb_int mrb_get_args_v(mrb_state *mrb, mrb_args_format format, void** ptr, va_list ap);
/*
retrieve arguments from mrb_state.

MODIFY
src/gc.c
src/gc.c
@@ -214,6 +214,10 @@ mrb_static_assert(MRB_GC_RED <= GC_COLOR_MASK);
#define other_white_part(s) ((s)->current_white_part ^ GC_WHITES)
#define is_dead(s, o) (((o)->color & other_white_part(s) & GC_WHITES) || (o)->tt == MRB_TT_FREE)
+/* We have removed `objects[]` from `mrb_heap_page` since it was not C++
+ * compatible. Using array index to get pointer after structure instead. */
+
+/* #define objects(p) ((RVALUE *)p->objects) */
#define objects(p) ((RVALUE *)&p[1])
mrb_noreturn void mrb_raise_nomemory(mrb_state *mrb);

Added comments about removal of objects[]
Made mrb_get_args_v() static