Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Levijev <vladimir.levijev@zabbix.com>2015-11-06 10:35:41 +0300
committerVladimir Levijev <vladimir.levijev@zabbix.com>2015-11-06 10:35:41 +0300
commit422ffba1598f4b2ae5a1861dc140ec3d1775e1c1 (patch)
treeef138921296abf65a1c427bd225d9221831644ea /include/zbxtypes.h
parentc32b258c03a33a06a28f613f289237c0a9610f0c (diff)
...G...... [ZBX-2966] move ZBX_IS_TOP_BIT_SET macro sysinfo.h -> zbxtypes.h
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r--include/zbxtypes.h3
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