131 */ |
131 */ |
132 typedef size_t(*read_func)(void*, size_t, size_t, void*); |
132 typedef size_t(*read_func)(void*, size_t, size_t, void*); |
133 |
133 |
134 |
134 |
135 |
135 |
136 #if defined(__GNUC__) || defined(__clang__) |
136 #if __GNUC__ >= 5 || defined(__clang__) |
137 #define UCX_MUL_BUILTIN |
137 #define UCX_MUL_BUILTIN |
138 |
138 |
139 #if __WORDSIZE == 32 |
139 #if __WORDSIZE == 32 |
140 /** |
140 /** |
141 * Alias for <code>__builtin_umul_overflow</code>. |
141 * Alias for <code>__builtin_umul_overflow</code>. |
179 * @param result a pointer to a size_t, where the result should |
179 * @param result a pointer to a size_t, where the result should |
180 * be stored |
180 * be stored |
181 * @return zero, if no overflow occurred and the result is correct, non-zero |
181 * @return zero, if no overflow occurred and the result is correct, non-zero |
182 * otherwise |
182 * otherwise |
183 */ |
183 */ |
184 int ucx_szmul(size_t a, size_t b, size_t *result); |
184 #define ucx_szmul(a, b, result) ucx_szmul_impl(a, b, result) |
|
185 |
|
186 int ucx_szmul_impl(size_t a, size_t b, size_t *result); |
185 |
187 |
186 #endif |
188 #endif |
187 |
189 |
188 #ifdef __cplusplus |
190 #ifdef __cplusplus |
189 } |
191 } |