aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 59f5d640cc..f6742cd458 100644
--- a/internal.h
+++ b/internal.h
@@ -2066,6 +2066,19 @@ rb_obj_builtin_type(VALUE obj)
# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
#endif
+/*
+ * For declaring bitfields out of non-unsigned int types:
+ * struct date {
+ * BITFIELD(enum months) month:4;
+ * ...
+ * };
+ */
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define BITFIELD(type) type
+#else
+# define BITFIELD(type) unsigned int
+#endif
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */