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:
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