diff options
author | Sutou Kouhei <[email protected]> | 2023-10-28 06:11:30 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-11-08 09:25:44 +0900 |
commit | 2a6d6d3d65de43635a5f6ad38dbca170f1e40119 (patch) | |
tree | 097aff88d59c4e7329138d98408ff706846f28fe /ext/fiddle/fiddle.c | |
parent | d30ea5831e0aedada3362a2d268e7bc836b93f27 (diff) |
[ruby/fiddle] Use Ruby's true/false for C bool
GitHub: fix https://github.com/ruby/fiddle/pull/130
Reported by Benoit Daloze. Thanks!!!
https://github.com/ruby/fiddle/commit/2640e0148e
Diffstat (limited to 'ext/fiddle/fiddle.c')
-rw-r--r-- | ext/fiddle/fiddle.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c index 49120704ab..f420d9fa3b 100644 --- a/ext/fiddle/fiddle.c +++ b/ext/fiddle/fiddle.c @@ -363,7 +363,7 @@ Init_fiddle(void) * * C type - bool */ - rb_define_const(mFiddleTypes, "BOOL" , rb_fiddle_type_bool()); + rb_define_const(mFiddleTypes, "BOOL" , INT2NUM(TYPE_BOOL)); /* Document-const: ALIGN_VOIDP * @@ -469,6 +469,12 @@ Init_fiddle(void) */ rb_define_const(mFiddle, "ALIGN_UINTPTR_T", INT2NUM(ALIGN_OF(uintptr_t))); + /* Document-const: ALIGN_BOOL + * + * The alignment size of a bool + */ + rb_define_const(mFiddle, "ALIGN_BOOL", INT2NUM(ALIGN_OF(bool))); + /* Document-const: WINDOWS * * Returns a boolean regarding whether the host is WIN32 |