aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2024-04-25 09:25:15 +0200
committer卜部昌平 <shyouhei@ruby-lang.org>2024-04-27 21:55:28 +0900
commitbb5a53820703f5e1af886a0c5ca7178aa976be29 (patch)
tree4e7d416e1c1811cad81e0c7e73db8fde722875b5 /gc.c
parent9ea77cb3514664fc150515765fb9ede5b2b6ab4c (diff)
downloadruby-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 41207b6eb2..59201458f1 100644
--- a/gc.c
+++ b/gc.c
@@ -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);