aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-07-14 12:34:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-14 12:36:35 +0200
commit73309f19e582a712e78f54988fc51dbc5ab60bf4 (patch)
treeced9f0106753410aed6ab49d134936acbea0f65e /include
parent6ad80bb4b2c1680e9447703b55b6a97b345e1f37 (diff)
downloadlibssh-73309f19e582a712e78f54988fc51dbc5ab60bf4.tar.gz
libssh-73309f19e582a712e78f54988fc51dbc5ab60bf4.tar.xz
libssh-73309f19e582a712e78f54988fc51dbc5ab60bf4.zip
cmake: Check if we have Thread Local Storage support.
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 7168cf55..d7974026 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -130,6 +130,14 @@ int gettimeofday(struct timeval *__p, void *__t);
#endif
#endif
+#if defined(HAVE_GCC_THREAD_LOCAL_STORAGE)
+# define LIBSSH_THREAD __thread
+#elif defined(HAVE_MSC_THREAD_LOCAL_STORAGE)
+# define LIBSSH_THREAD __declspec(thread)
+#else
+# define LIBSSH_THREAD
+#endif
+
#define enter_function() (void)session
#define leave_function() (void)session