src/ucx/ucx.h

changeset 270
3d80d425543b
parent 259
2f5dea574a75
child 283
c3b6ff227481
     1.1 --- a/src/ucx/ucx.h	Tue Jan 02 17:00:21 2018 +0100
     1.2 +++ b/src/ucx/ucx.h	Sun Jan 21 10:13:21 2018 +0100
     1.3 @@ -131,6 +131,15 @@
     1.4   */
     1.5  typedef size_t(*read_func)(void*, size_t, size_t, void*);
     1.6  
     1.7 +
     1.8 +
     1.9 +#if defined(__GNUC__) || defined(__clang__)
    1.10 +#define UCX_MUL_BUILTIN
    1.11 +#define ucx_szmul(a, b, result) __builtin_umull_overflow(a, b, result)
    1.12 +#else
    1.13 +int ucx_szmul(size_t a, size_t b, size_t *result);
    1.14 +#endif
    1.15 +
    1.16  #ifdef	__cplusplus
    1.17  }
    1.18  #endif

mercurial