Rename `union mrb_value` to `union mrb_value_`.
Since some compiler complains when we `typedef` `mrb_value`.
MODIFY
include/mruby/boxing_nan.h
include/mruby/boxing_nan.h
*/
typedef uint64_t mrb_value;
-union mrb_value {
+union mrb_value_ {
mrb_float f;
uint64_t u;
#ifdef MRB_64BIT
@@ -52,10 +52,10 @@ union mrb_value {
};
};
-static inline union mrb_value
+static inline union mrb_value_
mrb_val_union(mrb_value v)
{
- union mrb_value x;
+ union mrb_value_ x;
x.u = v;
return x;
}
@@ -77,7 +77,7 @@ mrb_val_union(mrb_value v)
#endif
#define BOXNAN_SET_VALUE(o, tt, attr, v) do { \
- union mrb_value mrb_value_union_variable; \
+ union mrb_value_ mrb_value_union_variable; \
mrb_value_union_variable.attr = (v);\
mrb_value_union_variable.ttt = 0xfff00000 | (((tt)+1)<<14);\
o = mrb_value_union_variable.u;\
@@ -85,7 +85,7 @@ mrb_val_union(mrb_value v)
#ifdef MRB_64BIT
#define BOXNAN_SET_OBJ_VALUE(o, tt, v) do {\
- union mrb_value mrb_value_union_variable;\
+ union mrb_value_ mrb_value_union_variable;\
mrb_value_union_variable.p = (void*)((uintptr_t)(v)>>2);\
mrb_value_union_variable.ttt = (0xfff00000|(((tt)+1)<<14)|BOXNAN_SHIFT_LONG_POINTER(v));\
o = mrb_value_union_variable.u;\
@@ -95,7 +95,7 @@ mrb_val_union(mrb_value v)
#endif
#define SET_FLOAT_VALUE(mrb,r,v) do { \
- union mrb_value mrb_value_union_variable; \
+ union mrb_value_ mrb_value_union_variable; \
if ((v) != (v)) { /* NaN */ \
mrb_value_union_variable.ttt = 0x7ff80000; \
mrb_value_union_variable.i = 0; \

MODIFY
include/mruby/boxing_word.h
include/mruby/boxing_word.h
@@ -68,7 +68,7 @@ enum mrb_special_consts {
* object: ...PPPP P000 (any bits are 1)
*/
typedef uintptr_t mrb_value;
-union mrb_value {
+union mrb_value_ {
void *p;
#ifdef MRB_64BIT
/* use struct to avoid bit shift. */
@@ -87,10 +87,10 @@ union mrb_value {
uintptr_t w;
};
-static inline union mrb_value
+static inline union mrb_value_
mrb_val_union(mrb_value v)
{
- union mrb_value x;
+ union mrb_value_ x;
x.w = v;
return x;
}
@@ -158,7 +158,7 @@ MRB_API mrb_value mrb_word_boxing_float_value(struct mrb_state*, mrb_float);
#define SET_INT_VALUE(r,n) BOXWORD_SET_SHIFT_VALUE(r, FIXNUM, n)
#ifdef MRB_64BIT
#define SET_SYM_VALUE(r,v) do {\
- union mrb_value mrb_value_union_variable;\
+ union mrb_value_ mrb_value_union_variable;\
mrb_value_union_variable.sym = v;\
mrb_value_union_variable.sym_flag = BOXWORD_SYMBOL_FLAG;\
(r) = mrb_value_union_variable.w;\

MODIFY
src/etc.c
src/etc.c
@@ -151,7 +151,7 @@ mrb_obj_id(mrb_value obj)
MRB_API mrb_value
mrb_word_boxing_float_value(mrb_state *mrb, mrb_float f)
{
- union mrb_value v;
+ union mrb_value_ v;
v.p = mrb_obj_alloc(mrb, MRB_TT_FLOAT, mrb->float_class);
v.fp->f = f;

Rename `union mrb_value` to `union mrb_value_`.

Since some compiler complains when we `typedef` `mrb_value`.