Commit 373684fd authored by Thomas Haller's avatar Thomas Haller

shared: add _nm_thread_local macro

Copied and adjusted from systemd.
parent d554f535
......@@ -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"
/*****************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment