feat(headers): stddef/stdint/stdbool/limits/float/assert + features wiring

This commit is contained in:
2026-09-03 17:34:16 -04:00
parent ce517ad0d6
commit dec1017527
22 changed files with 2076 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef VLIBC_STDCKDINT_H
#define VLIBC_STDCKDINT_H
/*
* vlibc — <stdckdint.h>.
*
* Checked integer arithmetic (C23). Each macro computes the operation and
* stores the result through *result; it returns true when the mathematical
* result is not representable in the result type, in which case *result is
* left unmodified. The implementation defers to the GCC
* __builtin_*_overflow family, which is type-generic across every integer
* type, matching the standard's semantics.
*
* This header is ISO C core and is present in every profile.
*/
#include <vlibc/features.h>
#define ckd_add(result, a, b) __builtin_add_overflow((a), (b), (result))
#define ckd_sub(result, a, b) __builtin_sub_overflow((a), (b), (result))
#define ckd_mul(result, a, b) __builtin_mul_overflow((a), (b), (result))
#endif /* VLIBC_STDCKDINT_H */