mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 08:20:28 +01:00
shared: add _nm_thread_local macro
Copied and adjusted from systemd.
This commit is contained in:
parent
d554f535af
commit
373684fdc0
1 changed files with 16 additions and 0 deletions
|
|
@ -32,6 +32,22 @@
|
|||
#define _nm_const __attribute__ ((const))
|
||||
#define _nm_printf(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifdef thread_local
|
||||
#define _nm_thread_local thread_local
|
||||
/*
|
||||
* Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__
|
||||
* see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769
|
||||
*/
|
||||
#elif __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16))
|
||||
#define _nm_thread_local _Thread_local
|
||||
#else
|
||||
#define _nm_thread_local __thread
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "nm-glib.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue