# HG changeset patch # User Olaf Wintermann # Date 1538895608 -7200 # Node ID 3b985a4eb05b445817d6a17ef516cd23dcaa27fd # Parent d2bbf907a189747b7f68223c480fd9bf9563c956 fixes ucx_szmul definition for gcc < 5 diff -r d2bbf907a189 -r 3b985a4eb05b src/ucx.c --- a/src/ucx.c Fri Sep 28 21:47:30 2018 +0200 +++ b/src/ucx.c Sun Oct 07 09:00:08 2018 +0200 @@ -45,8 +45,7 @@ #include "ucx/ucx.h" -#ifndef UCX_MUL_BUILTIN -int ucx_szmul(size_t a, size_t b, size_t *result) { +int ucx_szmul_impl(size_t a, size_t b, size_t *result) { if(a == 0 || b == 0) { *result = 0; return 0; @@ -60,5 +59,4 @@ return 1; } } -#endif diff -r d2bbf907a189 -r 3b985a4eb05b src/ucx/ucx.h --- a/src/ucx/ucx.h Fri Sep 28 21:47:30 2018 +0200 +++ b/src/ucx/ucx.h Sun Oct 07 09:00:08 2018 +0200 @@ -133,7 +133,7 @@ -#if defined(__GNUC__) || defined(__clang__) +#if __GNUC__ >= 5 || defined(__clang__) #define UCX_MUL_BUILTIN #if __WORDSIZE == 32 @@ -181,7 +181,9 @@ * @return zero, if no overflow occurred and the result is correct, non-zero * otherwise */ -int ucx_szmul(size_t a, size_t b, size_t *result); +#define ucx_szmul(a, b, result) ucx_szmul_impl(a, b, result) + +int ucx_szmul_impl(size_t a, size_t b, size_t *result); #endif