stdckdint.h 1.5 KB

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