Skip to content

Commit 199e1c9

Browse files
ZERICO2005mateoconlechuga
authored andcommitted
Added C23/C++26 <stdckdint.h>
1 parent 1f718f3 commit 199e1c9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/libc/header_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <stdarg.h>
1717
#include <stdbit.h>
1818
#include <stdbool.h>
19+
#include <stdckdint.h>
1920
#include <stddef.h>
2021
#include <stdint.h>
2122
#include <stdio.h>

src/libc/include/stdckdint.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef _STDCKDINT_H
2+
#define _STDCKDINT_H
3+
4+
#define __STDC_VERSION_STDCKDINT_H__ 202311L
5+
6+
#define ckd_add(R, A, B) __builtin_add_overflow((A), (B), (R))
7+
#define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
8+
#define ckd_mul(R, A, B) __builtin_mul_overflow((A), (B), (R))
9+
10+
#endif /* _STDCKDINT_H */

src/libcxx/header_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include <stdarg.h>
5555
#include <stdbit.h>
5656
#include <stdbool.h>
57+
#include <stdckdint.h>
5758
#include <stddef.h>
5859
#include <stdint.h>
5960
#include <stdio.h>

0 commit comments

Comments
 (0)