Turbo Haskell  0.1
 All Classes Functions Variables Pages
thread_local.h
1 #ifndef INCLUDED_RTS_THREAD_LOCAL_H
2 #define INCLUDED_RTS_THREAD_LOCAL_H
3 
4 #ifndef thread_local
5 # if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__
6 # define thread_local _Thread_local
7 # elif defined _WIN32 && ( \
8  defined _MSC_VER || \
9  defined __ICL || \
10  defined __DMC__ || \
11  defined __BORLANDC__ )
12 # define thread_local __declspec(thread)
13 /* note that ICC (linux) and Clang are covered by __GNUC__ */
14 # elif defined __GNUC__ || \
15  defined __SUNPRO_C || \
16  defined __xlC__
17 # define thread_local __thread
18 # else
19 # error "Cannot define thread_local"
20 # endif
21 #endif
22 
23 #endif