diff options
| author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-03 16:06:50 +0200 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-03 16:06:50 +0200 |
| commit | a79b6fb7c2941e5fd1b58414d1d8778f86ceab5d (patch) | |
| tree | b34230d98c1dd8f61da3fc3a81ecba3abc648d60 | |
| parent | ecc3df6cae302e56e60d707114b53f59ca2d88e1 (diff) | |
| download | socket_wrapper-a79b6fb7c2941e5fd1b58414d1d8778f86ceab5d.tar.gz socket_wrapper-a79b6fb7c2941e5fd1b58414d1d8778f86ceab5d.tar.xz socket_wrapper-a79b6fb7c2941e5fd1b58414d1d8778f86ceab5d.zip | |
cmake: Check for Thread Local Storage.
| -rw-r--r-- | ConfigureChecks.cmake | 7 | ||||
| -rw-r--r-- | config.h.cmake | 1 | ||||
| -rw-r--r-- | src/socket_wrapper.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 10373c1..151745a 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -144,6 +144,13 @@ int main(void) { return 0; }" HAVE_DESTRUCTOR_ATTRIBUTE) +check_c_source_compiles(" +__thread int tls; + +int main(void) { + return 0; +}" HAVE_GCC_THREAD_LOCAL_STORAGE) + check_library_exists(dl dlopen "" HAVE_LIBDL) if (HAVE_LIBDL) find_library(DLFCN_LIBRARY dl) diff --git a/config.h.cmake b/config.h.cmake index 99c599f..6302645 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -28,6 +28,7 @@ /**************************** OPTIONS ****************************/ +#cmakedefine HAVE_GCC_THREAD_LOCAL_STORAGE 1 #cmakedefine HAVE_DESTRUCTOR_ATTRIBUTE 1 #cmakedefine HAVE_SOCKADDR_STORAGE 1 #cmakedefine HAVE_IPV6 1 diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index ac1ea03..e0d29e0 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -87,7 +87,7 @@ enum swrap_dbglvl_e { #define DESTRUCTOR_ATTRIBUTE #endif -#ifdef __GNUC__ +#ifdef HAVE_GCC_THREAD_LOCAL_STORAGE # define SWRAP_THREAD __thread #else # define SWRAP_THREAD |
