summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-22 04:04:06 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-22 04:04:06 +0000
commit84fd997fe6460e5fcccbae557e95068cf94cd55d (patch)
tree033171b77cdbf50683e12d0f0d54edc46413be4e
parentd4313df0851e85a4bd3343b44932195953cbd6bf (diff)
downloadruby-84fd997fe6460e5fcccbae557e95068cf94cd55d.tar.gz
Avoid compiler depend error
ref r64492 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--cont.c2
-rw-r--r--internal.h6
-rw-r--r--method.h4
-rw-r--r--vm_core.h2
4 files changed, 7 insertions, 7 deletions
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;