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:
authorAndris Zeila <andris.zeila@zabbix.com>2020-08-05 15:58:58 +0300
committerAndris Zeila <andris.zeila@zabbix.com>2020-08-05 15:59:20 +0300
commit88332506254610fac89e887bd27868348da948e0 (patch)
tree0c88e694ed5e67d6e08633f882de507d0deb97c3 /include/zbxtypes.h
parent37cfb1959505dce432cab05e0f515198fcef7574 (diff)
...G...... [ZBX-16998] improved agent binary compatibility by removing __thread attribute when not building agent2
* commit '7f7970126f09818d4567acd2d7a91ec7a0b71106': .D........ [ZBX-16998] added changelog entry .......... [ZBX-16998] fixed agent2 build on windows ...G...... [ZBX-16998] removed __thread usage when building only C targets (cherry picked from commit 75ea8679f05b892a9d09c6ba5fe3ecb9b47e332f)
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r--include/zbxtypes.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index b64ca0dde44..0d3a5b421ed 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -20,12 +20,20 @@
#ifndef ZABBIX_TYPES_H
#define ZABBIX_TYPES_H
+#include "sysinc.h"
+
#if defined(_WINDOWS)
# define ZBX_THREAD_LOCAL __declspec(thread)
#else
-# if defined(HAVE_THREAD_LOCAL) && (defined(__GNUC__) || defined(__clang__) || defined(__MINGW32__))
-# define ZBX_THREAD_LOCAL __thread
-# else
+/* for non windows build thread local storage is required only for agent2 */
+# if defined(ZBX_BUILD_AGENT2)
+# if defined(HAVE_THREAD_LOCAL) && (defined(__GNUC__) || defined(__clang__) || defined(__MINGW32__))
+# define ZBX_THREAD_LOCAL __thread
+# else
+# error "C compiler is not compatible with agent2 assembly"
+# endif
+# endif
+# if !defined(ZBX_THREAD_LOCAL)
# define ZBX_THREAD_LOCAL
# endif
#endif