aboutsummaryrefslogtreecommitdiffstats
path: root/method.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:50 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-02 06:41:50 +0000
commitdb5d556f9b6ada9388fe73b925724a06eb23611b (patch)
tree02813ee6b1415cbf2ff1c427dfa4479be8399c2e /method.h
parentb8f8c20295a45ac7a473e2d0af4780d6702e6014 (diff)
downloadruby-db5d556f9b6ada9388fe73b925724a06eb23611b.tar.gz
bit-fields other than int is a C99ism
To be precise C90 says "A bit-field may have type int, unsigned int, or signed int". It is clear that char or enum are NG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'method.h')
-rw-r--r--method.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/method.h b/method.h
index dc430401a7..7c1ce3b8b3 100644
--- a/method.h
+++ b/method.h
@@ -32,10 +32,16 @@ typedef enum {
METHOD_VISI_MASK = 0x03
} rb_method_visibility_t;
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+#define bits_t rb_method_visibility_t
+#else
+#define bits_t unsigned int
+#endif
typedef struct rb_scope_visi_struct {
- rb_method_visibility_t method_visi : 3;
+ bits_t method_visi : 3;
unsigned int module_func : 1;
} rb_scope_visibility_t;
+#undef bits_t
/*! CREF (Class REFerence) */
typedef struct rb_cref_struct {