# HG changeset patch # User Mike Becker # Date 1675796888 -3600 # Node ID 12c2b10b51a9e8bff22a9f47bd7d0c46b3f998e6 # Parent 4e115b610b375a55c9a2ed01508d4c21217e5fc3 fix wrong types for umul overflow builtins diff -r 4e115b610b37 -r 12c2b10b51a9 src/cx/utils.h --- a/src/cx/utils.h Tue Feb 07 20:06:33 2023 +0100 +++ b/src/cx/utils.h Tue Feb 07 20:08:08 2023 +0100 @@ -58,20 +58,6 @@ #if __WORDSIZE == 32 /** - * Alias for \c __builtin_umul_overflow. - * - * Performs a multiplication of size_t values and checks for overflow. - * - * @param a first operand - * @param b second operand - * @param result a pointer to a size_t, where the result should - * be stored - * @return zero, if no overflow occurred and the result is correct, non-zero - * otherwise - */ -#define cx_szmul(a, b, result) __builtin_umul_overflow(a, b, result) -#else // __WORDSIZE != 32 -/** * Alias for \c __builtin_umull_overflow. * * Performs a multiplication of size_t values and checks for overflow. @@ -84,6 +70,20 @@ * otherwise */ #define cx_szmul(a, b, result) __builtin_umull_overflow(a, b, result) +#else // __WORDSIZE != 32 +/** + * Alias for \c __builtin_umulll_overflow. + * + * Performs a multiplication of size_t values and checks for overflow. + * + * @param a first operand + * @param b second operand + * @param result a pointer to a size_t, where the result should + * be stored + * @return zero, if no overflow occurred and the result is correct, non-zero + * otherwise + */ +#define cx_szmul(a, b, result) __builtin_umulll_overflow(a, b, result) #endif // __WORDSIZE #else // no GNUC or clang bultin