diff --git a/cont.c b/cont.c index 408db21a6d..0f68a99315 100644 --- a/cont.c +++ b/cont.c @@ -175,7 +175,7 @@ struct rb_fiber_struct { 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". diff --git a/internal.h b/internal.h index 20df1453e2..de62de1029 100644 --- a/internal.h +++ b/internal.h @@ -2144,14 +2144,14 @@ rb_obj_builtin_type(VALUE obj) /* * 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) diff --git a/method.h b/method.h index 9e0f5e7c47..f6222ca4ae 100644 --- a/method.h +++ b/method.h @@ -33,7 +33,7 @@ typedef enum { } 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 { }; 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; diff --git a/vm_core.h b/vm_core.h index b936b0352b..1e27e7f839 100644 --- a/vm_core.h +++ b/vm_core.h @@ -879,7 +879,7 @@ typedef struct rb_thread_struct { #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;