diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2024-04-25 09:25:15 +0200 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2024-04-27 21:55:28 +0900 |
commit | bb5a53820703f5e1af886a0c5ca7178aa976be29 (patch) | |
tree | 4e7d416e1c1811cad81e0c7e73db8fde722875b5 /gc.c | |
parent | 9ea77cb3514664fc150515765fb9ede5b2b6ab4c (diff) | |
download | ruby-bb5a53820703f5e1af886a0c5ca7178aa976be29.tar.gz |
use of stdckdint.h
C23 is going to have this header. The industry is already moving
towards accepting it; OSes and compilers started to implement theirs.
Why not detect its presence and if any, prefer over other ways.
See also:
- https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf
- https://reviews.freebsd.org/D41734
- https://reviews.llvm.org/D157331
- https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8441841a1b985d68245954af1ff023db121b0635
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -224,6 +224,9 @@ size_add_overflow(size_t x, size_t y) bool p; #if 0 +#elif defined(ckd_add) + p = ckd_add(&z, x, y); + #elif __has_builtin(__builtin_add_overflow) p = __builtin_add_overflow(x, y, &z); |