summaryrefslogtreecommitdiff
path: root/ext/fiddle/fiddle.c
diff options
context:
space:
mode:
authorSutou Kouhei <[email protected]>2023-07-03 16:43:41 +0900
committerHiroshi SHIBATA <[email protected]>2023-08-02 18:17:18 +0900
commit15e8cf7ad95f5ea9ec95783e85a9ac5943f020f4 (patch)
tree74f9378920b7ea4302f4044c97b01943274e9525 /ext/fiddle/fiddle.c
parent10588fa12136b30b44affa209cb49afd4a8d7aa7 (diff)
[ruby/fiddle] Add support for bool
GitHub: fix https://github.com/ruby/fiddle/pull/130 Reported by Benoit Daloze. Thanks!!! https://github.com/ruby/fiddle/commit/bc6c66bbb9
Diffstat (limited to 'ext/fiddle/fiddle.c')
-rw-r--r--ext/fiddle/fiddle.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index 9ab1283ba3..c285bc20de 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -357,6 +357,12 @@ Init_fiddle(void)
*/
rb_define_const(mFiddleTypes, "UINTPTR_T", INT2NUM(TYPE_UINTPTR_T));
+ /* Document-const: Fiddle::Types::BOOL
+ *
+ * C type - bool
+ */
+ rb_define_const(mFiddleTypes, "BOOL" , rb_fiddle_type_bool());
+
/* Document-const: ALIGN_VOIDP
*
* The alignment size of a void*
@@ -635,6 +641,12 @@ Init_fiddle(void)
*/
rb_define_const(mFiddle, "SIZEOF_CONST_STRING", INT2NUM(sizeof(const char*)));
+ /* Document-const: SIZEOF_BOOL
+ *
+ * size of a bool
+ */
+ rb_define_const(mFiddle, "SIZEOF_BOOL", INT2NUM(sizeof(bool)));
+
/* Document-const: RUBY_FREE
*
* Address of the ruby_xfree() function