3 #if defined(HAVE_TYPE_SIG_ATOMIC_T)
7 #if defined(HAVE_TYPE_WINT_T) || defined(HAVE_TYPE_WCTRANS_T) || defined(HAVE_TYPE_WCTYPE_T)
11 extern void Init_limits(
void);
18 #define DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size))
19 #define DEFINE_SIZE(type) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(sizeof(type)))
21 #if defined(SIZEOF_INT) && SIZEOF_INT != 0
24 #if defined(SIZEOF_SHORT) && SIZEOF_SHORT != 0
27 #if defined(SIZEOF_LONG) && SIZEOF_LONG != 0
30 #if defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG != 0 && defined(HAVE_TRUE_LONG_LONG)
33 #if defined(SIZEOF___INT64) && SIZEOF___INT64 != 0
34 DEFINE(__int64, __INT64);
36 #ifdef HAVE_TYPE___INT128
37 DEFINE_SIZE(__int128);
39 #if defined(SIZEOF_OFF_T) && SIZEOF_OFF_T != 0
42 #if defined(SIZEOF_VOIDP) && SIZEOF_VOIDP != 0
45 #if defined(SIZEOF_FLOAT) && SIZEOF_FLOAT != 0
48 #if defined(SIZEOF_DOUBLE) && SIZEOF_DOUBLE != 0
49 DEFINE(
double, DOUBLE);
51 #if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T != 0
52 DEFINE(time_t, TIME_T);
54 #if defined(SIZEOF_CLOCK_T) && SIZEOF_CLOCK_T != 0
55 DEFINE(clock_t, CLOCK_T);
57 #if defined(SIZEOF_SIZE_T) && SIZEOF_SIZE_T != 0
58 DEFINE(
size_t, SIZE_T);
60 #if defined(SIZEOF_PTRDIFF_T) && SIZEOF_PTRDIFF_T != 0
61 DEFINE(ptrdiff_t, PTRDIFF_T);
63 #if defined(SIZEOF_DEV_T) && SIZEOF_DEV_T != 0
66 #if defined(SIZEOF_INT8_T) && SIZEOF_INT8_T != 0
67 DEFINE(int8_t, INT8_T);
69 #if defined(SIZEOF_UINT8_T) && SIZEOF_UINT8_T != 0
70 DEFINE(uint8_t, UINT8_T);
72 #if defined(SIZEOF_INT16_T) && SIZEOF_INT16_T != 0
73 DEFINE(int16_t, INT16_T);
75 #if defined(SIZEOF_UINT16_T) && SIZEOF_UINT16_T != 0
76 DEFINE(uint16_t, UINT16_T);
78 #if defined(SIZEOF_INT32_T) && SIZEOF_INT32_T != 0
79 DEFINE(int32_t, INT32_T);
81 #if defined(SIZEOF_UINT32_T) && SIZEOF_UINT32_T != 0
82 DEFINE(uint32_t, UINT32_T);
84 #if defined(SIZEOF_INT64_T) && SIZEOF_INT64_T != 0
85 DEFINE(int64_t, INT64_T);
87 #if defined(SIZEOF_UINT64_T) && SIZEOF_UINT64_T != 0
88 DEFINE(uint64_t, UINT64_T);
90 #if defined(SIZEOF_INT128_T) && SIZEOF_INT128_T != 0
91 DEFINE(int128_t, INT128_T);
93 #if defined(SIZEOF_UINT128_T) && SIZEOF_UINT128_T != 0
94 DEFINE(uint128_t, UINT128_T);
96 #if defined(SIZEOF_INTPTR_T) && SIZEOF_INTPTR_T != 0
97 DEFINE(intptr_t, INTPTR_T);
99 #if defined(SIZEOF_UINTPTR_T) && SIZEOF_UINTPTR_T != 0
100 DEFINE(uintptr_t, UINTPTR_T);
102 #if defined(SIZEOF_SSIZE_T) && SIZEOF_SSIZE_T != 0
103 DEFINE(ssize_t, SSIZE_T);
105 #ifdef HAVE_TYPE_INT_LEAST8_T
106 DEFINE_SIZE(int_least8_t);
108 #ifdef HAVE_TYPE_INT_LEAST16_T
109 DEFINE_SIZE(int_least16_t);
111 #ifdef HAVE_TYPE_INT_LEAST32_T
112 DEFINE_SIZE(int_least32_t);
114 #ifdef HAVE_TYPE_INT_LEAST64_T
115 DEFINE_SIZE(int_least64_t);
117 #ifdef HAVE_TYPE_INT_FAST8_T
118 DEFINE_SIZE(int_fast8_t);
120 #ifdef HAVE_TYPE_INT_FAST16_T
121 DEFINE_SIZE(int_fast16_t);
123 #ifdef HAVE_TYPE_INT_FAST32_T
124 DEFINE_SIZE(int_fast32_t);
126 #ifdef HAVE_TYPE_INT_FAST64_T
127 DEFINE_SIZE(int_fast64_t);
129 #ifdef HAVE_TYPE_INTMAX_T
130 DEFINE_SIZE(intmax_t);
132 #ifdef HAVE_TYPE_SIG_ATOMIC_T
133 DEFINE_SIZE(sig_atomic_t);
135 #ifdef HAVE_TYPE_WCHAR_T
136 DEFINE_SIZE(
wchar_t);
138 #ifdef HAVE_TYPE_WINT_T
141 #ifdef HAVE_TYPE_WCTRANS_T
142 DEFINE_SIZE(wctrans_t);
144 #ifdef HAVE_TYPE_WCTYPE_T
145 DEFINE_SIZE(wctype_t);
147 #ifdef HAVE_TYPE__BOOL
150 #ifdef HAVE_TYPE_LONG_DOUBLE
151 DEFINE_SIZE(
long double);
153 #ifdef HAVE_TYPE_FLOAT__COMPLEX
154 DEFINE_SIZE(
float _Complex);
156 #ifdef HAVE_TYPE_DOUBLE__COMPLEX
157 DEFINE_SIZE(
double _Complex);
159 #ifdef HAVE_TYPE_LONG_DOUBLE__COMPLEX
160 DEFINE_SIZE(
long double _Complex);
162 #ifdef HAVE_TYPE_FLOAT__IMAGINARY
163 DEFINE_SIZE(
float _Imaginary);
165 #ifdef HAVE_TYPE_DOUBLE__IMAGINARY
166 DEFINE_SIZE(
double _Imaginary);
168 #ifdef HAVE_TYPE_LONG_DOUBLE__IMAGINARY
169 DEFINE_SIZE(
long double _Imaginary);
171 #ifdef HAVE_TYPE___INT128
172 DEFINE_SIZE(__int128);
174 #ifdef HAVE_TYPE___FLOAT128
175 DEFINE_SIZE(__float128);
177 #ifdef HAVE_TYPE__DECIMAL32
178 DEFINE_SIZE(_Decimal32);
180 #ifdef HAVE_TYPE__DECIMAL64
181 DEFINE_SIZE(_Decimal64);
183 #ifdef HAVE_TYPE__DECIMAL128
184 DEFINE_SIZE(_Decimal128);
186 #ifdef HAVE_TYPE___M64
189 #ifdef HAVE_TYPE___M128
192 #ifdef HAVE_TYPE___FLOAT80
193 DEFINE_SIZE(__float80);
VALUE rb_define_module(const char *name)
Defines a top-level module.
#define OBJ_FREEZE
Old name of RB_OBJ_FREEZE.
VALUE rb_hash_new(void)
Creates a new, empty hash object.
void rb_define_const(VALUE klass, const char *name, VALUE val)
Defines a Ruby level constant under a namespace.
uintptr_t VALUE
Type that represents a Ruby object.