mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 00:55:56 +00:00
libnm-core,libnm-util: avoid calling a constructor
It yields completely unpredictable results on Ubuntu 12.04 (the global variable successfully comparing to NULL despite demonstrably not NULL). Possibly a toolchain bug.
This commit is contained in:
parent
3811a68389
commit
ccb0ca4493
|
@ -91,7 +91,7 @@ _nm_gtype_hash (gconstpointer v)
|
|||
return *((const GType *) v);
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
static void
|
||||
_ensure_registered (void)
|
||||
{
|
||||
if (G_UNLIKELY (registered_settings == NULL)) {
|
||||
|
@ -103,6 +103,12 @@ _ensure_registered (void)
|
|||
}
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
_ensure_registered_constructor (void)
|
||||
{
|
||||
_ensure_registered ();
|
||||
}
|
||||
|
||||
#define _ensure_setting_info(self, priv) \
|
||||
G_STMT_START { \
|
||||
NMSettingPrivate *_priv_esi = (priv); \
|
||||
|
|
|
@ -99,7 +99,7 @@ _nm_gtype_hash (gconstpointer v)
|
|||
return *((const GType *) v);
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
static void
|
||||
_ensure_registered (void)
|
||||
{
|
||||
if (G_UNLIKELY (registered_settings == NULL)) {
|
||||
|
@ -112,6 +112,12 @@ _ensure_registered (void)
|
|||
}
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
_ensure_registered_constructor (void)
|
||||
{
|
||||
_ensure_registered ();
|
||||
}
|
||||
|
||||
#define _ensure_setting_info(self, priv) \
|
||||
G_STMT_START { \
|
||||
NMSettingPrivate *_priv_esi = (priv); \
|
||||
|
|
Loading…
Reference in a new issue