stdckdint.h (404B)
1 /* stdckdint.h -- C23 7.20 -- Checked integer arithmetic */ 2 #ifndef KIT_STDCKDINT_H 3 #define KIT_STDCKDINT_H 4 5 #include <stdbool.h> 6 7 #define __STDC_VERSION_STDCKDINT_H__ 202311L 8 9 #define ckd_add(result, a, b) __builtin_add_overflow((a), (b), (result)) 10 #define ckd_sub(result, a, b) __builtin_sub_overflow((a), (b), (result)) 11 #define ckd_mul(result, a, b) __builtin_mul_overflow((a), (b), (result)) 12 13 #endif