summaryrefslogtreecommitdiffstats
path: root/gl/stdckdint.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/stdckdint.h')
-rw-r--r--gl/stdckdint.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/gl/stdckdint.h b/gl/stdckdint.h
new file mode 100644
index 00000000..8eeac909
--- /dev/null
+++ b/gl/stdckdint.h
@@ -0,0 +1,38 @@
1/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2/* stdckdint.h -- checked integer arithmetic
3
4 Copyright 2022 Free Software Foundation, Inc.
5
6 This program is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18
19#ifndef _GL_STDCKDINT_H
20#define _GL_STDCKDINT_H
21
22#include "intprops-internal.h"
23
24#include <stdbool.h>
25
26/* Store into *R the low-order bits of A + B, A - B, A * B, respectively.
27 Return 1 if the result overflows, 0 otherwise.
28 A, B, and *R can have any integer type other than char, bool, a
29 bit-precise integer type, or an enumeration type.
30
31 These are like the standard macros introduced in C23, except that
32 arguments should not have side effects. */
33
34#define ckd_add(r, a, b) ((bool) _GL_INT_ADD_WRAPV (a, b, r))
35#define ckd_sub(r, a, b) ((bool) _GL_INT_SUBTRACT_WRAPV (a, b, r))
36#define ckd_mul(r, a, b) ((bool) _GL_INT_MULTIPLY_WRAPV (a, b, r))
37
38#endif /* _GL_STDCKDINT_H */