ruby-changes:52295
From: kazu <ko1@a...>
Date: Wed, 22 Aug 2018 13:04:12 +0900 (JST)
Subject: [ruby-changes:52295] kazu:r64503 (trunk): Avoid compiler depend error
kazu 2018-08-22 13:04:06 +0900 (Wed, 22 Aug 2018) New Revision: 64503 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64503 Log: Avoid compiler depend error ref r64492 Modified files: trunk/cont.c trunk/internal.h trunk/method.h trunk/vm_core.h Index: cont.c =================================================================== --- cont.c (revision 64502) +++ cont.c (revision 64503) @@ -175,7 +175,7 @@ struct rb_fiber_struct { https://github.com/ruby/ruby/blob/trunk/cont.c#L175 rb_context_t cont; VALUE first_proc; struct rb_fiber_struct *prev; - BITFIELD(enum fiber_status) status : 2; + BITFIELD(enum fiber_status, status, 2); /* If a fiber invokes "transfer", * then this fiber can't "resume" any more after that. * You shouldn't mix "transfer" and "resume". Index: method.h =================================================================== --- method.h (revision 64502) +++ method.h (revision 64503) @@ -33,7 +33,7 @@ typedef enum { https://github.com/ruby/ruby/blob/trunk/method.h#L33 } rb_method_visibility_t; typedef struct rb_scope_visi_struct { - BITFIELD(rb_method_visibility_t) method_visi : 3; + BITFIELD(rb_method_visibility_t, method_visi, 3); unsigned int module_func : 1; } rb_scope_visibility_t; @@ -155,7 +155,7 @@ enum method_optimized_type { https://github.com/ruby/ruby/blob/trunk/method.h#L155 }; PACKED_STRUCT_UNALIGNED(struct rb_method_definition_struct { - BITFIELD(rb_method_type_t) type : VM_METHOD_TYPE_MINIMUM_BITS; + BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS); int alias_count : 28; int complemented_count : 28; Index: vm_core.h =================================================================== --- vm_core.h (revision 64502) +++ vm_core.h (revision 64503) @@ -879,7 +879,7 @@ typedef struct rb_thread_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L879 #ifdef NON_SCALAR_THREAD_ID rb_thread_id_string_t thread_id_string; #endif - BITFIELD(enum rb_thread_status) status : 2; + BITFIELD(enum rb_thread_status, status, 2); /* bit flags */ unsigned int to_kill : 1; unsigned int abort_on_exception: 1; Index: internal.h =================================================================== --- internal.h (revision 64502) +++ internal.h (revision 64503) @@ -2144,14 +2144,14 @@ rb_obj_builtin_type(VALUE obj) https://github.com/ruby/ruby/blob/trunk/internal.h#L2144 /* * For declaring bitfields out of non-unsigned int types: * struct date { - * BITFIELD(enum months) month:4; + * BITFIELD(enum months, month, 4); * ... * }; */ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) -# define BITFIELD(type) type +# define BITFIELD(type, name, size) type name : size #else -# define BITFIELD(type) unsigned int +# define BITFIELD(type, name, size) unsigned int name : size #endif #if defined(_MSC_VER) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/