diff options
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r-- | include/zbxtypes.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h index d89395cfcbd..1ae1500b289 100644 --- a/include/zbxtypes.h +++ b/include/zbxtypes.h @@ -163,4 +163,7 @@ zbx_uint128_t; #define ZBX_SIZE_T_ALIGN8(size) (((size) + 7) & ~(size_t)7) +/* macro to test if a signed value has been assigned to unsigned type (char, short, int, long long) */ +#define ZBX_IS_TOP_BIT_SET(x) (0 != ((__UINT64_C(1) << ((sizeof(x) << 3) - 1)) & (zbx_uint64_t)(x))) + #endif |