# endif
#endif
+/* Determine compiler support for TLS */
+#ifndef Z_TLS
+# if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__
+# define Z_TLS _Thread_local
+# elif defined(__GNUC__) || defined(__SUNPRO_C)
+# define Z_TLS __thread
+# elif defined(_WIN32) && (defined(_MSC_VER) || defined(__ICL))
+# define Z_TLS __declspec(thread)
+# else
+# warning Unable to detect Thread Local Storage support.
+# define Z_TLS
+# endif
+#endif
+
/* This has to be first include that defines any types */
#if defined(_MSC_VER)
# if defined(_WIN64)