mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
glib: add internal macro G_THREAD_LOCAL for support for thread local storage
_Thread_local is also C11, so possibly other compilers would also support it. However, since not *all* compilers support it, it can anyway only be used as optimization and conditional asserts. As such, the current detection based on __GNUC__ to only support gcc (and clang) is good enough.
This commit is contained in:
parent
6c389738d3
commit
a12f0731dd
@ -321,4 +321,10 @@ GLibPrivateVTable *glib__private__ (void);
|
||||
gboolean g_uint_equal (gconstpointer v1, gconstpointer v2);
|
||||
guint g_uint_hash (gconstpointer v);
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define G_THREAD_LOCAL __thread
|
||||
#else
|
||||
#undef G_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
#endif /* __GLIB_PRIVATE_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user