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:
@@ -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); \
|
||||
|
Reference in New Issue
Block a user