diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2024-04-29 03:09:15 +0200 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2024-04-29 03:09:15 +0200 |
commit | b7bd55cdc7125c4d383eea0e9be6e57015cd19b5 (patch) | |
tree | a715a240c85950b89d3b2272ebff4ee6f68db5c8 | |
parent | 17a0e2ac049d051f7c5af00d0a179d1b4efc3005 (diff) |
suppress -Wold-style-cast warnings
-rw-r--r-- | include/ruby/internal/stdckdint.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ruby/internal/stdckdint.h b/include/ruby/internal/stdckdint.h index 33647a5a47..e5b5b8b751 100644 --- a/include/ruby/internal/stdckdint.h +++ b/include/ruby/internal/stdckdint.h @@ -20,6 +20,7 @@ * @brief C23 shim for <stdckdint.h> */ #include "ruby/internal/config.h" +#include "ruby/internal/cast.h" #include "ruby/internal/has/builtin.h" #include "ruby/internal/stdbool.h" @@ -47,9 +48,9 @@ # include <stdckdint.h> #elif RBIMPL_HAS_BUILTIN(__builtin_add_overflow) -# define ckd_add(x, y, z) ((bool)__builtin_add_overflow((y), (z), (x))) -# define ckd_sub(x, y, z) ((bool)__builtin_sub_overflow((y), (z), (x))) -# define ckd_mul(x, y, z) ((bool)__builtin_mul_overflow((y), (z), (x))) +# define ckd_add(x, y, z) RBIMPL_CAST((bool)__builtin_add_overflow((y), (z), (x))) +# define ckd_sub(x, y, z) RBIMPL_CAST((bool)__builtin_sub_overflow((y), (z), (x))) +# define ckd_mul(x, y, z) RBIMPL_CAST((bool)__builtin_mul_overflow((y), (z), (x))) # define __STDC_VERSION_STDCKDINT_H__ 202311L #/* elif defined(__cplusplus) */ |