zscan 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/ext/extconf.rb +9 -1
  3. data/ext/pack/builtin-27.h +79 -0
  4. data/ext/pack/builtin.h +79 -0
  5. data/ext/pack/internal-27.h +96 -0
  6. data/ext/pack/internal-27/array.h +103 -0
  7. data/ext/pack/internal-27/bignum.h +246 -0
  8. data/ext/pack/internal-27/bits.h +566 -0
  9. data/ext/pack/internal-27/class.h +162 -0
  10. data/ext/pack/internal-27/compar.h +50 -0
  11. data/ext/pack/internal-27/compile.h +32 -0
  12. data/ext/pack/internal-27/compilers.h +108 -0
  13. data/ext/pack/internal-27/complex.h +29 -0
  14. data/ext/pack/internal-27/cont.h +23 -0
  15. data/ext/pack/internal-27/dir.h +17 -0
  16. data/ext/pack/internal-27/enc.h +20 -0
  17. data/ext/pack/internal-27/encoding.h +28 -0
  18. data/ext/pack/internal-27/enum.h +19 -0
  19. data/ext/pack/internal-27/enumerator.h +22 -0
  20. data/ext/pack/internal-27/error.h +129 -0
  21. data/ext/pack/internal-27/eval.h +33 -0
  22. data/ext/pack/internal-27/file.h +39 -0
  23. data/ext/pack/internal-27/fixnum.h +185 -0
  24. data/ext/pack/internal-27/gc.h +153 -0
  25. data/ext/pack/internal-27/hash.h +234 -0
  26. data/ext/pack/internal-27/imemo.h +242 -0
  27. data/ext/pack/internal-27/inits.h +51 -0
  28. data/ext/pack/internal-27/io.h +35 -0
  29. data/ext/pack/internal-27/load.h +19 -0
  30. data/ext/pack/internal-27/loadpath.h +17 -0
  31. data/ext/pack/internal-27/math.h +24 -0
  32. data/ext/pack/internal-27/missing.h +19 -0
  33. data/ext/pack/internal-27/mjit.h +29 -0
  34. data/ext/pack/internal-27/numeric.h +249 -0
  35. data/ext/pack/internal-27/object.h +60 -0
  36. data/ext/pack/internal-27/parse.h +23 -0
  37. data/ext/pack/internal-27/proc.h +32 -0
  38. data/ext/pack/internal-27/process.h +130 -0
  39. data/ext/pack/internal-27/random.h +17 -0
  40. data/ext/pack/internal-27/range.h +37 -0
  41. data/ext/pack/internal-27/rational.h +68 -0
  42. data/ext/pack/internal-27/re.h +29 -0
  43. data/ext/pack/internal-27/sanitizers.h +191 -0
  44. data/ext/pack/internal-27/serial.h +24 -0
  45. data/ext/pack/internal-27/signal.h +22 -0
  46. data/ext/pack/internal-27/static_assert.h +17 -0
  47. data/ext/pack/internal-27/string.h +135 -0
  48. data/ext/pack/internal-27/struct.h +154 -0
  49. data/ext/pack/internal-27/symbol.h +41 -0
  50. data/ext/pack/internal-27/thread.h +52 -0
  51. data/ext/pack/internal-27/time.h +35 -0
  52. data/ext/pack/internal-27/transcode.h +21 -0
  53. data/ext/pack/internal-27/util.h +31 -0
  54. data/ext/pack/internal-27/variable.h +92 -0
  55. data/ext/pack/internal-27/vm.h +127 -0
  56. data/ext/pack/internal-27/warnings.h +17 -0
  57. data/ext/pack/internal.h +57 -2102
  58. data/ext/pack/internal/array.h +103 -0
  59. data/ext/pack/internal/bignum.h +246 -0
  60. data/ext/pack/internal/bits.h +566 -0
  61. data/ext/pack/internal/class.h +162 -0
  62. data/ext/pack/internal/compar.h +50 -0
  63. data/ext/pack/internal/compile.h +32 -0
  64. data/ext/pack/internal/compilers.h +108 -0
  65. data/ext/pack/internal/complex.h +29 -0
  66. data/ext/pack/internal/cont.h +23 -0
  67. data/ext/pack/internal/dir.h +17 -0
  68. data/ext/pack/internal/enc.h +20 -0
  69. data/ext/pack/internal/encoding.h +28 -0
  70. data/ext/pack/internal/enum.h +19 -0
  71. data/ext/pack/internal/enumerator.h +22 -0
  72. data/ext/pack/internal/error.h +129 -0
  73. data/ext/pack/internal/eval.h +33 -0
  74. data/ext/pack/internal/file.h +39 -0
  75. data/ext/pack/internal/fixnum.h +185 -0
  76. data/ext/pack/internal/gc.h +153 -0
  77. data/ext/pack/internal/hash.h +234 -0
  78. data/ext/pack/internal/imemo.h +242 -0
  79. data/ext/pack/internal/inits.h +51 -0
  80. data/ext/pack/internal/io.h +35 -0
  81. data/ext/pack/internal/load.h +19 -0
  82. data/ext/pack/internal/loadpath.h +17 -0
  83. data/ext/pack/internal/math.h +24 -0
  84. data/ext/pack/internal/missing.h +19 -0
  85. data/ext/pack/internal/mjit.h +29 -0
  86. data/ext/pack/internal/numeric.h +249 -0
  87. data/ext/pack/internal/object.h +60 -0
  88. data/ext/pack/internal/parse.h +23 -0
  89. data/ext/pack/internal/proc.h +32 -0
  90. data/ext/pack/internal/process.h +130 -0
  91. data/ext/pack/internal/random.h +17 -0
  92. data/ext/pack/internal/range.h +37 -0
  93. data/ext/pack/internal/rational.h +68 -0
  94. data/ext/pack/internal/re.h +29 -0
  95. data/ext/pack/internal/sanitizers.h +191 -0
  96. data/ext/pack/internal/serial.h +24 -0
  97. data/ext/pack/internal/signal.h +22 -0
  98. data/ext/pack/internal/static_assert.h +17 -0
  99. data/ext/pack/internal/string.h +135 -0
  100. data/ext/pack/internal/struct.h +154 -0
  101. data/ext/pack/internal/symbol.h +41 -0
  102. data/ext/pack/internal/thread.h +52 -0
  103. data/ext/pack/internal/time.h +35 -0
  104. data/ext/pack/internal/transcode.h +21 -0
  105. data/ext/pack/internal/util.h +31 -0
  106. data/ext/pack/internal/variable.h +92 -0
  107. data/ext/pack/internal/vm.h +127 -0
  108. data/ext/pack/internal/warnings.h +17 -0
  109. data/ext/pack/pack-26.c +2 -109
  110. data/ext/pack/pack-27.c +1022 -0
  111. data/ext/pack/pack.c +57 -1047
  112. data/lib/zscan.rb +1 -1
  113. data/zscan.gemspec +1 -1
  114. metadata +109 -3
@@ -0,0 +1,162 @@
1
+ #ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_CLASS_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Class.
11
+ */
12
+ #include "id_table.h" /* for struct rb_id_table */
13
+ #include "internal/gc.h" /* for RB_OBJ_WRITE */
14
+ #include "internal/serial.h" /* for rb_serial_t */
15
+ #include "ruby/internal/stdbool.h" /* for bool */
16
+ #include "ruby/intern.h" /* for rb_alloc_func_t */
17
+ #include "ruby/ruby.h" /* for struct RBasic */
18
+
19
+ #ifdef RClass
20
+ # undef RClass /* See also include/ruby/backward.h */
21
+ #endif
22
+
23
+ #ifdef RCLASS_SUPER
24
+ # undef RCLASS_SUPER
25
+ #endif
26
+
27
+ struct rb_deprecated_classext_struct {
28
+ char conflict[sizeof(VALUE) * 3];
29
+ };
30
+
31
+ struct rb_subclass_entry {
32
+ VALUE klass;
33
+ struct rb_subclass_entry *next;
34
+ };
35
+
36
+ struct rb_classext_struct {
37
+ struct st_table *iv_index_tbl;
38
+ struct st_table *iv_tbl;
39
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
40
+ struct rb_id_table *m_tbl;
41
+ #endif
42
+ struct rb_id_table *const_tbl;
43
+ struct rb_id_table *callable_m_tbl;
44
+ struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
45
+ struct rb_subclass_entry *subclasses;
46
+ struct rb_subclass_entry **parent_subclasses;
47
+ /**
48
+ * In the case that this is an `ICLASS`, `module_subclasses` points to the link
49
+ * in the module's `subclasses` list that indicates that the klass has been
50
+ * included. Hopefully that makes sense.
51
+ */
52
+ struct rb_subclass_entry **module_subclasses;
53
+ #if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
54
+ rb_serial_t class_serial;
55
+ #endif
56
+ const VALUE origin_;
57
+ const VALUE refined_class;
58
+ rb_alloc_func_t allocator;
59
+ const VALUE includer;
60
+ };
61
+
62
+ struct RClass {
63
+ struct RBasic basic;
64
+ VALUE super;
65
+ struct rb_classext_struct *ptr;
66
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
67
+ /* Class serial is as wide as VALUE. Place it here. */
68
+ rb_serial_t class_serial;
69
+ #else
70
+ /* Class serial does not fit into struct RClass. Place m_tbl instead. */
71
+ struct rb_id_table *m_tbl;
72
+ #endif
73
+ };
74
+
75
+ typedef struct rb_subclass_entry rb_subclass_entry_t;
76
+ typedef struct rb_classext_struct rb_classext_t;
77
+
78
+ #define RCLASS_EXT(c) (RCLASS(c)->ptr)
79
+ #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
80
+ #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
81
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
82
+ # define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
83
+ #else
84
+ # define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
85
+ #endif
86
+ #define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
87
+ #define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
88
+ #define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
89
+ #define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
90
+ #define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
91
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
92
+ # define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
93
+ #else
94
+ # define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
95
+ #endif
96
+ #define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
97
+
98
+ #define RCLASS_CLONED FL_USER6
99
+ #define RICLASS_IS_ORIGIN FL_USER5
100
+ #define RCLASS_REFINED_BY_ANY FL_USER7
101
+
102
+ /* class.c */
103
+ void rb_class_subclass_add(VALUE super, VALUE klass);
104
+ void rb_class_remove_from_super_subclasses(VALUE);
105
+ int rb_singleton_class_internal_p(VALUE sklass);
106
+ VALUE rb_class_boot(VALUE);
107
+ VALUE rb_make_metaclass(VALUE, VALUE);
108
+ VALUE rb_include_class_new(VALUE, VALUE);
109
+ void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
110
+ void rb_class_detach_subclasses(VALUE);
111
+ void rb_class_detach_module_subclasses(VALUE);
112
+ void rb_class_remove_from_module_subclasses(VALUE);
113
+ VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
114
+ VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
115
+ VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
116
+ VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
117
+ VALUE rb_special_singleton_class(VALUE);
118
+ VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
119
+ VALUE rb_singleton_class_get(VALUE obj);
120
+ int rb_class_has_methods(VALUE c);
121
+ void rb_undef_methods_from(VALUE klass, VALUE super);
122
+ static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
123
+ static inline VALUE RCLASS_SUPER(VALUE klass);
124
+ static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
125
+ static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
126
+
127
+ MJIT_SYMBOL_EXPORT_BEGIN
128
+ VALUE rb_class_inherited(VALUE, VALUE);
129
+ VALUE rb_keyword_error_new(const char *, VALUE);
130
+ MJIT_SYMBOL_EXPORT_END
131
+
132
+ static inline void
133
+ RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
134
+ {
135
+ RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
136
+ if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
137
+ }
138
+
139
+ static inline void
140
+ RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
141
+ {
142
+ RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
143
+ }
144
+
145
+ static inline VALUE
146
+ RCLASS_SUPER(VALUE klass)
147
+ {
148
+ return RCLASS(klass)->super;
149
+ }
150
+
151
+ static inline VALUE
152
+ RCLASS_SET_SUPER(VALUE klass, VALUE super)
153
+ {
154
+ if (super) {
155
+ rb_class_remove_from_super_subclasses(klass);
156
+ rb_class_subclass_add(super, klass);
157
+ }
158
+ RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
159
+ return super;
160
+ }
161
+
162
+ #endif /* INTERNAL_CLASS_H */
@@ -0,0 +1,50 @@
1
+ #ifndef INTERNAL_COMPAR_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPAR_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Comparable.
11
+ */
12
+ #include "internal/vm.h" /* for rb_method_basic_definition_p */
13
+
14
+ #define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
15
+
16
+ enum {
17
+ cmp_opt_Integer,
18
+ cmp_opt_String,
19
+ cmp_opt_Float,
20
+ cmp_optimizable_count
21
+ };
22
+
23
+ struct cmp_opt_data {
24
+ unsigned int opt_methods;
25
+ unsigned int opt_inited;
26
+ };
27
+
28
+ #define NEW_CMP_OPT_MEMO(type, value) \
29
+ NEW_PARTIAL_MEMO_FOR(type, value, cmp_opt)
30
+ #define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type))
31
+ #define CMP_OPTIMIZABLE(data, type) \
32
+ (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
33
+ ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
34
+ (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
35
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
36
+ ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
37
+
38
+ #define OPTIMIZED_CMP(a, b, data) \
39
+ ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Integer)) ? \
40
+ (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
41
+ (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
42
+ rb_str_cmp(a, b) : \
43
+ (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(data, Float)) ? \
44
+ rb_float_cmp(a, b) : \
45
+ rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b))
46
+
47
+ /* compar.c */
48
+ VALUE rb_invcmp(VALUE, VALUE);
49
+
50
+ #endif /* INTERNAL_COMPAR_H */
@@ -0,0 +1,32 @@
1
+ #ifndef INTERNAL_COMPILE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPILE_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for the compiler.
11
+ */
12
+ #include "ruby/internal/config.h"
13
+ #include <stddef.h> /* for size_t */
14
+ #include "ruby/ruby.h" /* for rb_event_flag_t */
15
+
16
+ struct rb_iseq_struct; /* in vm_core.h */
17
+
18
+ /* compile.c */
19
+ int rb_dvar_defined(ID, const struct rb_iseq_struct *);
20
+ int rb_local_defined(ID, const struct rb_iseq_struct *);
21
+ const char *rb_insns_name(int i);
22
+ VALUE rb_insns_name_array(void);
23
+
24
+ /* iseq.c */
25
+ int rb_vm_insn_addr2insn(const void *);
26
+
27
+ MJIT_SYMBOL_EXPORT_BEGIN
28
+ /* iseq.c (export) */
29
+ rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos);
30
+ MJIT_SYMBOL_EXPORT_END
31
+
32
+ #endif /* INTERNAL_COMPILE_H */
@@ -0,0 +1,108 @@
1
+ #ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPILERS_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header absorbing C compipler differences.
11
+ */
12
+ #include "ruby/internal/compiler_since.h"
13
+ #include "ruby/internal/has/attribute.h"
14
+ #include "ruby/internal/has/builtin.h"
15
+ #include "ruby/internal/has/c_attribute.h"
16
+ #include "ruby/internal/has/declspec_attribute.h"
17
+ #include "ruby/internal/has/extension.h"
18
+ #include "ruby/internal/has/feature.h"
19
+ #include "ruby/internal/has/warning.h"
20
+ #include "ruby/backward/2/gcc_version_since.h"
21
+
22
+ #define MSC_VERSION_SINCE(_) RBIMPL_COMPILER_SINCE(MSVC, (_) / 100, (_) % 100, 0)
23
+ #define MSC_VERSION_BEFORE(_) RBIMPL_COMPILER_BEFORE(MSVC, (_) / 100, (_) % 100, 0)
24
+
25
+ #ifndef __has_attribute
26
+ # define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__)
27
+ #endif
28
+
29
+ #ifndef __has_c_attribute
30
+ # /* As of writing everything that lacks __has_c_attribute also completely
31
+ # * lacks C2x attributes as well. Might change in future? */
32
+ # define __has_c_attribute(...) 0
33
+ #endif
34
+
35
+ #ifndef __has_declspec_attribute
36
+ # define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__)
37
+ #endif
38
+
39
+ #ifndef __has_builtin
40
+ # define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
41
+ #endif
42
+
43
+ #ifndef __has_feature
44
+ # define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__)
45
+ #endif
46
+
47
+ #ifndef __has_extension
48
+ # define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__)
49
+ #endif
50
+
51
+ #ifndef __has_warning
52
+ # define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__)
53
+ #endif
54
+
55
+ #ifndef __GNUC__
56
+ # define __extension__ /* void */
57
+ #endif
58
+
59
+ #ifndef MAYBE_UNUSED
60
+ # define MAYBE_UNUSED(x) x
61
+ #endif
62
+
63
+ #ifndef WARN_UNUSED_RESULT
64
+ # define WARN_UNUSED_RESULT(x) x
65
+ #endif
66
+
67
+ #define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
68
+ #define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
69
+ #ifdef __GNUC__
70
+ #define rb_obj_builtin_type(obj) \
71
+ __extension__({ \
72
+ VALUE arg_obj = (obj); \
73
+ RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
74
+ (int)RB_BUILTIN_TYPE(arg_obj); \
75
+ })
76
+ #else
77
+ # include "ruby/ruby.h"
78
+ static inline int
79
+ rb_obj_builtin_type(VALUE obj)
80
+ {
81
+ return RB_SPECIAL_CONST_P(obj) ? -1 :
82
+ (int)RB_BUILTIN_TYPE(obj);
83
+ }
84
+ #endif
85
+
86
+ /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
87
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
88
+ # define FLEX_ARY_LEN /* VALUE ary[]; */
89
+ #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
90
+ # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
91
+ #else
92
+ # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
93
+ #endif
94
+
95
+ /*
96
+ * For declaring bitfields out of non-unsigned int types:
97
+ * struct date {
98
+ * BITFIELD(enum months, month, 4);
99
+ * ...
100
+ * };
101
+ */
102
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
103
+ # define BITFIELD(type, name, size) type name : size
104
+ #else
105
+ # define BITFIELD(type, name, size) unsigned int name : size
106
+ #endif
107
+
108
+ #endif /* INTERNAL_COMPILERS_H */
@@ -0,0 +1,29 @@
1
+ #ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPLEX_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Complex.
11
+ */
12
+ #include "ruby/internal/value.h" /* for struct RBasic */
13
+
14
+ struct RComplex {
15
+ struct RBasic basic;
16
+ VALUE real;
17
+ VALUE imag;
18
+ };
19
+
20
+ #define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
21
+
22
+ /* shortcut macro for internal only */
23
+ #define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
24
+ #define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
25
+
26
+ /* complex.c */
27
+ VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
28
+
29
+ #endif /* INTERNAL_COMPLEX_H */
@@ -0,0 +1,23 @@
1
+ #ifndef INTERNAL_CONT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_CONT_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Fiber.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ struct rb_thread_struct; /* in vm_core.h */
15
+ struct rb_fiber_struct; /* in cont.c */
16
+
17
+ /* cont.c */
18
+ VALUE rb_obj_is_fiber(VALUE);
19
+ void rb_fiber_reset_root_local_storage(struct rb_thread_struct *);
20
+ void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE));
21
+ void rb_fiber_init_mjit_cont(struct rb_fiber_struct *fiber);
22
+
23
+ #endif /* INTERNAL_CONT_H */
@@ -0,0 +1,17 @@
1
+ #ifndef INTERNAL_DIR_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_DIR_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Dir.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* dir.c */
15
+ VALUE rb_dir_getwd_ospath(void);
16
+
17
+ #endif /* INTERNAL_DIR_H */
@@ -0,0 +1,20 @@
1
+ #ifndef INTERNAL_ENC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_ENC_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Encoding.
11
+ */
12
+ #include "ruby/encoding.h" /* for rb_encoding */
13
+
14
+ /* us_ascii.c */
15
+ extern rb_encoding OnigEncodingUS_ASCII;
16
+
17
+ /* utf_8.c */
18
+ extern rb_encoding OnigEncodingUTF_8;
19
+
20
+ #endif /* INTERNAL_ENC_H */