1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Avoid compiler depend error

ref r64492

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-08-22 04:04:06 +00:00
parent d4313df085
commit 84fd997fe6
4 changed files with 7 additions and 7 deletions

2
cont.c
View file

@ -175,7 +175,7 @@ struct rb_fiber_struct {
rb_context_t cont; rb_context_t cont;
VALUE first_proc; VALUE first_proc;
struct rb_fiber_struct *prev; struct rb_fiber_struct *prev;
BITFIELD(enum fiber_status) status : 2; BITFIELD(enum fiber_status, status, 2);
/* If a fiber invokes "transfer", /* If a fiber invokes "transfer",
* then this fiber can't "resume" any more after that. * then this fiber can't "resume" any more after that.
* You shouldn't mix "transfer" and "resume". * You shouldn't mix "transfer" and "resume".

View file

@ -2144,14 +2144,14 @@ rb_obj_builtin_type(VALUE obj)
/* /*
* For declaring bitfields out of non-unsigned int types: * For declaring bitfields out of non-unsigned int types:
* struct date { * struct date {
* BITFIELD(enum months) month:4; * BITFIELD(enum months, month, 4);
* ... * ...
* }; * };
*/ */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define BITFIELD(type) type # define BITFIELD(type, name, size) type name : size
#else #else
# define BITFIELD(type) unsigned int # define BITFIELD(type, name, size) unsigned int name : size
#endif #endif
#if defined(_MSC_VER) #if defined(_MSC_VER)

View file

@ -33,7 +33,7 @@ typedef enum {
} rb_method_visibility_t; } rb_method_visibility_t;
typedef struct rb_scope_visi_struct { 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; unsigned int module_func : 1;
} rb_scope_visibility_t; } rb_scope_visibility_t;
@ -155,7 +155,7 @@ enum method_optimized_type {
}; };
PACKED_STRUCT_UNALIGNED(struct rb_method_definition_struct { 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 alias_count : 28;
int complemented_count : 28; int complemented_count : 28;

View file

@ -879,7 +879,7 @@ typedef struct rb_thread_struct {
#ifdef NON_SCALAR_THREAD_ID #ifdef NON_SCALAR_THREAD_ID
rb_thread_id_string_t thread_id_string; rb_thread_id_string_t thread_id_string;
#endif #endif
BITFIELD(enum rb_thread_status) status : 2; BITFIELD(enum rb_thread_status, status, 2);
/* bit flags */ /* bit flags */
unsigned int to_kill : 1; unsigned int to_kill : 1;
unsigned int abort_on_exception: 1; unsigned int abort_on_exception: 1;