g_type_init() is now provided by nm-glib-compat.h as nm_g_type_init().
g_option_context_free (opt_ctx);
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm \
-I${top_builddir}/libnm \
+ -I${top_srcdir}/include \
$(GLIB_CFLAGS) \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMLOCALEDIR=\"$(datadir)/locale\"
#include "polkit-agent.h"
#include "nmcli.h"
+#include "nm-glib-compat.h"
#include "utils.h"
#include "common.h"
#include "connections.h"
textdomain (GETTEXT_PACKAGE);
#endif
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
-
+ nm_g_type_init ();
+
/* Save terminal settings */
tcgetattr (STDIN_FILENO, &termios_orig);
#include <glib/gi18n.h>
#include <NetworkManager.h>
+#include "nm-glib-compat.h"
#define PROGRESS_STEPS 15
#define WAIT_STARTUP_TAG "wait-startup"
}
remaining_ms = t_secs * 1000;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
client = nm_client_new (NULL, &error);
if (!client) {
__nmtst_internal.assert_logging = !!assert_logging;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
is_debug = g_test_verbose ();
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
-{ g_type_init (); g_type_ensure (x); }
+{ nm_g_type_init (); g_type_ensure (x); }
GVariant *_nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting,
NMConnection *connection,
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
registered_settings = g_hash_table_new (g_str_hash, g_str_equal);
registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
}
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- g_type_init ();
+ nm_g_type_init ();
_nm_dbus_errors_init ();
}
#include "nm-active-connection.h"
#include "nm-vpn-connection.h"
#include "nm-setting-ip4-config.h"
+#include "nm-glib-compat.h"
static gboolean
test_wireless_enabled (NMClient *client)
{
NMClient *client;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
client = nm_client_new ();
if (!client) {
#include "NetworkManager.h"
#include "libnm_glib.h"
+#include "nm-glib-compat.h"
+
#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"
{
libnm_glib_ctx *ctx = NULL;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
if (!g_thread_supported ())
g_thread_init (NULL);
{
DBusGConnection *bus;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
/* Ensure the setting's GType is registered at library load time */
#define NM_SETTING_REGISTER_TYPE(x) \
static void __attribute__((constructor)) register_setting (void) \
-{ g_type_init (); g_type_ensure (x); }
+{ nm_g_type_init (); g_type_ensure (x); }
NMSetting *nm_setting_find_in_list (GSList *settings_list, const char *setting_name);
_ensure_registered (void)
{
if (G_UNLIKELY (registered_settings == NULL)) {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
_nm_value_transforms_register ();
registered_settings = g_hash_table_new (g_str_hash, g_str_equal);
registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal);
g_test_init (&argc, &argv, NULL);
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
success = nm_utils_init (&error);
g_assert_no_error (error);
static void __attribute__((constructor)) \
register_device_factory_internal_##lower (void) \
{ \
- g_type_init (); \
+ nm_g_type_init (); \
g_type_ensure (NM_TYPE_##upper##_FACTORY); \
} \
\
#include "NetworkManagerUtils.h"
#include "nm-dhcp-listener.h"
#include "gsystem-local-alloc.h"
+#include "nm-glib-compat.h"
G_DEFINE_TYPE (NMDhcpDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT)
static void __attribute__((constructor))
register_dhcp_dhclient (void)
{
- g_type_init ();
+ nm_g_type_init ();
_nm_dhcp_client_register (NM_TYPE_DHCP_DHCLIENT,
"dhclient",
nm_dhcp_dhclient_get_path,
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
#include "nm-dhcp-listener.h"
+#include "nm-glib-compat.h"
G_DEFINE_TYPE (NMDhcpDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT)
static void __attribute__((constructor))
register_dhcp_dhclient (void)
{
- g_type_init ();
+ nm_g_type_init ();
_nm_dhcp_client_register (NM_TYPE_DHCP_DHCPCD,
"dhcpcd",
nm_dhcp_dhcpcd_get_path,
static void __attribute__((constructor))
register_dhcp_dhclient (void)
{
- g_type_init ();
+ nm_g_type_init ();
_nm_dhcp_client_register (NM_TYPE_DHCP_SYSTEMD,
"internal",
NULL,
char *bad_domains = NULL;
NMConfigCmdLineOptions *config_cli;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
_nm_utils_is_manager_process = TRUE;
gconstpointer tmp;
gs_free NMUtilsIPv6IfaceId *iid = NULL;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
setpgid (getpid (), getpid ());
int
main (int argc, char **argv)
{
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
g_assert (argc <= 2);
if (argc > 1 && !g_strcmp0 (argv[1], "--fake"))
#include "nm-fake-platform.h"
#include "nm-linux-platform.h"
#include "nm-logging.h"
+#include "nm-glib-compat.h"
int
main (int argc, char **argv)
{
GMainLoop *loop;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
loop = g_main_loop_new (NULL, FALSE);
nm_logging_setup ("debug", NULL, NULL, NULL);
const command_t *command = NULL;
gboolean status = TRUE;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
if (*argv && !g_strcmp0 (argv[1], "--fake")) {
nm_fake_platform_setup ();
#include "nm-dbus-interface.h"
#include "nm-pppd-plugin.h"
#include "nm-ppp-status.h"
+#include "nm-glib-compat.h"
int plugin_init (void);
GDBusConnection *bus;
GError *err = NULL;
-#if !GLIB_CHECK_VERSION (2, 35, 0)
- g_type_init ();
-#endif
+ nm_g_type_init ();
g_message ("nm-ppp-plugin: (%s): initializing", __func__);