Rename `union mrb_value` to `union mrb_value_`.

Since some compiler complains when we `typedef` `mrb_value`.
parent 53e46be7
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
*/ */
typedef uint64_t mrb_value; typedef uint64_t mrb_value;
union mrb_value { union mrb_value_ {
mrb_float f; mrb_float f;
uint64_t u; uint64_t u;
#ifdef MRB_64BIT #ifdef MRB_64BIT
...@@ -52,10 +52,10 @@ union mrb_value { ...@@ -52,10 +52,10 @@ union mrb_value {
}; };
}; };
static inline union mrb_value static inline union mrb_value_
mrb_val_union(mrb_value v) mrb_val_union(mrb_value v)
{ {
union mrb_value x; union mrb_value_ x;
x.u = v; x.u = v;
return x; return x;
} }
...@@ -77,7 +77,7 @@ mrb_val_union(mrb_value v) ...@@ -77,7 +77,7 @@ mrb_val_union(mrb_value v)
#endif #endif
#define BOXNAN_SET_VALUE(o, tt, attr, v) do { \ #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.attr = (v);\
mrb_value_union_variable.ttt = 0xfff00000 | (((tt)+1)<<14);\ mrb_value_union_variable.ttt = 0xfff00000 | (((tt)+1)<<14);\
o = mrb_value_union_variable.u;\ o = mrb_value_union_variable.u;\
...@@ -85,7 +85,7 @@ mrb_val_union(mrb_value v) ...@@ -85,7 +85,7 @@ mrb_val_union(mrb_value v)
#ifdef MRB_64BIT #ifdef MRB_64BIT
#define BOXNAN_SET_OBJ_VALUE(o, tt, v) do {\ #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.p = (void*)((uintptr_t)(v)>>2);\
mrb_value_union_variable.ttt = (0xfff00000|(((tt)+1)<<14)|BOXNAN_SHIFT_LONG_POINTER(v));\ mrb_value_union_variable.ttt = (0xfff00000|(((tt)+1)<<14)|BOXNAN_SHIFT_LONG_POINTER(v));\
o = mrb_value_union_variable.u;\ o = mrb_value_union_variable.u;\
...@@ -95,7 +95,7 @@ mrb_val_union(mrb_value v) ...@@ -95,7 +95,7 @@ mrb_val_union(mrb_value v)
#endif #endif
#define SET_FLOAT_VALUE(mrb,r,v) do { \ #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 */ \ if ((v) != (v)) { /* NaN */ \
mrb_value_union_variable.ttt = 0x7ff80000; \ mrb_value_union_variable.ttt = 0x7ff80000; \
mrb_value_union_variable.i = 0; \ mrb_value_union_variable.i = 0; \
......
...@@ -68,7 +68,7 @@ enum mrb_special_consts { ...@@ -68,7 +68,7 @@ enum mrb_special_consts {
* object: ...PPPP P000 (any bits are 1) * object: ...PPPP P000 (any bits are 1)
*/ */
typedef uintptr_t mrb_value; typedef uintptr_t mrb_value;
union mrb_value { union mrb_value_ {
void *p; void *p;
#ifdef MRB_64BIT #ifdef MRB_64BIT
/* use struct to avoid bit shift. */ /* use struct to avoid bit shift. */
...@@ -87,10 +87,10 @@ union mrb_value { ...@@ -87,10 +87,10 @@ union mrb_value {
uintptr_t w; uintptr_t w;
}; };
static inline union mrb_value static inline union mrb_value_
mrb_val_union(mrb_value v) mrb_val_union(mrb_value v)
{ {
union mrb_value x; union mrb_value_ x;
x.w = v; x.w = v;
return x; return x;
} }
...@@ -158,7 +158,7 @@ MRB_API mrb_value mrb_word_boxing_float_value(struct mrb_state*, mrb_float); ...@@ -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) #define SET_INT_VALUE(r,n) BOXWORD_SET_SHIFT_VALUE(r, FIXNUM, n)
#ifdef MRB_64BIT #ifdef MRB_64BIT
#define SET_SYM_VALUE(r,v) do {\ #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 = v;\
mrb_value_union_variable.sym_flag = BOXWORD_SYMBOL_FLAG;\ mrb_value_union_variable.sym_flag = BOXWORD_SYMBOL_FLAG;\
(r) = mrb_value_union_variable.w;\ (r) = mrb_value_union_variable.w;\
......
...@@ -151,7 +151,7 @@ mrb_obj_id(mrb_value obj) ...@@ -151,7 +151,7 @@ mrb_obj_id(mrb_value obj)
MRB_API mrb_value MRB_API mrb_value
mrb_word_boxing_float_value(mrb_state *mrb, mrb_float f) 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.p = mrb_obj_alloc(mrb, MRB_TT_FLOAT, mrb->float_class);
v.fp->f = f; v.fp->f = f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment