aboutsummaryrefslogtreecommitdiff
path: root/odb/details/tls.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-03 16:20:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-03 16:20:38 +0200
commit0e2ae18a97fd507bac872031888d34c3a7d8b17b (patch)
tree3f9a551486969d2bc05f272e2da372c1a55d34cf /odb/details/tls.hxx
parent137b1eb3e41578d9d4a066ef75c6abfa597c46cd (diff)
Implement Win32 TLS support
Diffstat (limited to 'odb/details/tls.hxx')
-rw-r--r--odb/details/tls.hxx28
1 files changed, 5 insertions, 23 deletions
diff --git a/odb/details/tls.hxx b/odb/details/tls.hxx
index 7ce5c19..d2627be 100644
--- a/odb/details/tls.hxx
+++ b/odb/details/tls.hxx
@@ -50,7 +50,9 @@ namespace odb
#elif defined(ODB_THREADS_WIN32)
-# ifdef ODB_THREADS_TLS_DECLSPEC_POINTER
+# include <odb/details/win32/tls.hxx>
+
+# ifdef ODB_THREADS_TLS_DECLSPEC
# define ODB_TLS_POINTER(type) __declspec(thread) type*
namespace odb
@@ -74,29 +76,9 @@ namespace odb
}
# else
-# error unsupported TLS pointer model
-# endif
-
-# ifdef ODB_THREADS_TLS_DECLSPEC_OBJECT
-# define ODB_TLS_OBJECT(type) __declspec(thread) type
-
-namespace odb
-{
- namespace details
- {
- template <typename T>
- inline T&
- tls_get (T& x)
- {
- return x;
- }
- }
-}
-
-# else
-# error unsupported TLS object model
+# define ODB_TLS_POINTER(type) tls<type*>
# endif
-
+# define ODB_TLS_OBJECT(type) tls<type>
#else
# error unknown threading model
#endif