aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-13 11:45:25 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-13 11:45:25 +0000
commit7da7716159f296e0175aad3a23452ef9710e80e5 (patch)
treed8b10dc02bc0d11b4beb438e0626821bda168086 /internal.h
parentafcd060a926ab8ab8405bf51ca4c23d8abce4c21 (diff)
downloadruby-7da7716159f296e0175aad3a23452ef9710e80e5.tar.gz
internal.h (FLEX_ARY_LEN): Add a macro to define a flexible array
Also, use it in iseq.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index b83999464c..c9b16ca49a 100644
--- a/internal.h
+++ b/internal.h
@@ -2050,6 +2050,15 @@ rb_obj_builtin_type(VALUE obj)
}
#endif
+/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define FLEX_ARY_LEN /* VALUE ary[]; */
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
+# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
+#else
+# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
+#endif
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */