aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/stdckdint.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/include/stdckdint.h b/include/stdckdint.h
index 9cb877fe8198..fe1e100abe32 100644
--- a/include/stdckdint.h
+++ b/include/stdckdint.h
@@ -7,33 +7,11 @@
#ifndef __STDC_VERSION_STDCKDINT_H__
#define __STDC_VERSION_STDCKDINT_H__ 202311L
-#include <sys/cdefs.h>
+#include <sys/_visible.h>
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023
-#if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_add_overflow)
-#define ckd_add(result, a, b) \
- __builtin_add_overflow((a), (b), (result))
-#else
-#define ckd_add(result, a, b) \
- _Static_assert(0, "checked addition not supported")
-#endif
-
-#if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_sub_overflow)
-#define ckd_sub(result, a, b) \
- __builtin_sub_overflow((a), (b), (result))
-#else
-#define ckd_sub(result, a, b) \
- _Static_assert(0, "checked subtraction not supported")
-#endif
-
-#if __GNUC_PREREQ__(5, 1) || __has_builtin(__builtin_mul_overflow)
-#define ckd_mul(result, a, b) \
- __builtin_mul_overflow((a), (b), (result))
-#else
-#define ckd_mul(result, a, b) \
- _Static_assert(0, "checked multiplication not supported")
-#endif
+#include <sys/ckdint.h>
#endif