summaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-02-05 14:53:25 -0200
committerGravatar Yuri Kunde Schlesner2015-03-01 21:47:13 -0300
commitcd1fbfcf1b70e365d81480ec0f56db19ed02454f (patch)
treeb220b105d1b8016bb258047683bf2d03795c8881 /src/common/thread.h
parentMerge pull request #616 from archshift/5551 (diff)
downloadyuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.tar.gz
yuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.tar.xz
yuzu-cd1fbfcf1b70e365d81480ec0f56db19ed02454f.zip
Add profiling infrastructure and widget
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/thread.h b/src/common/thread.h
index eaf1ba00c..a45728e1e 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -24,6 +24,25 @@
24#include <unistd.h> 24#include <unistd.h>
25#endif 25#endif
26 26
27// Support for C++11's thread_local keyword was surprisingly spotty in compilers until very
28// recently. Fortunately, thread local variables have been well supported for compilers for a while,
29// but with semantics supporting only POD types, so we can use a few defines to get some amount of
30// backwards compat support.
31// WARNING: This only works correctly with POD types.
32#if defined(__clang__)
33# if !__has_feature(cxx_thread_local)
34# define thread_local __thread
35# endif
36#elif defined(__GNUC__)
37# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
38# define thread_local __thread
39# endif
40#elif defined(_MSC_VER)
41# if _MSC_VER < 1900
42# define thread_local __declspec(thread)
43# endif
44#endif
45
27namespace Common 46namespace Common
28{ 47{
29 48