summary refs log tree commit diff
path: root/libnm-util
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util')
-rw-r--r--libnm-util/crypto_nss.c17
-rw-r--r--libnm-util/meson.build7
-rw-r--r--libnm-util/nm-param-spec-specialized.c64
-rw-r--r--libnm-util/nm-setting-bond.c2
-rw-r--r--libnm-util/nm-setting-connection.c1
-rw-r--r--libnm-util/nm-setting-dcb.c14
-rw-r--r--libnm-util/nm-setting-dcb.h6
-rw-r--r--libnm-util/nm-setting-private.h6
-rw-r--r--libnm-util/nm-setting-vlan.c2
-rw-r--r--libnm-util/nm-setting.c12
-rw-r--r--libnm-util/nm-setting.h2
-rw-r--r--libnm-util/nm-utils.c18
-rw-r--r--libnm-util/tests/meson.build2
13 files changed, 77 insertions, 76 deletions
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c
index 01bb28c3..b55af774 100644
--- a/libnm-util/crypto_nss.c
+++ b/libnm-util/crypto_nss.c
@@ -441,7 +441,10 @@ crypto_verify_pkcs12 (const GByteArray *data,
 	PK11SlotInfo *slot = NULL;
 	SECStatus s;
 	char *ucs2_password;
-	long ucs2_chars = 0;
+	glong ucs2_chars = 0;
+#ifndef WORDS_BIGENDIAN
+	guint16 *p;
+#endif /* WORDS_BIGENDIAN */
 
 	if (error)
 		g_return_val_if_fail (*error == NULL, FALSE);
@@ -467,14 +470,10 @@ crypto_verify_pkcs12 (const GByteArray *data,
 		memset (ucs2_password, 0, ucs2_chars);
 		g_free (ucs2_password);
 
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-		{
-			guint16 *p;
-
-			for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++)
-				*p = GUINT16_SWAP_LE_BE (*p);
-		}
-#endif
+#ifndef WORDS_BIGENDIAN
+		for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++)
+			*p = GUINT16_SWAP_LE_BE (*p);
+#endif /* WORDS_BIGENDIAN */
 	} else {
 		/* NULL password */
 		pw.data = NULL;
diff --git a/libnm-util/meson.build b/libnm-util/meson.build
index 44d9e735..1e30fd9a 100644
--- a/libnm-util/meson.build
+++ b/libnm-util/meson.build
@@ -100,6 +100,7 @@ deps = [
 
 common_cflags = [
   '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL',
+  '-DNMLOCALEDIR="@0@"'.format(nm_localedir),
 ]
 
 cflags = common_cflags + [
@@ -191,10 +192,10 @@ if enable_introspection
   )
 endif
 
-test(
+run_target(
   'check-local-exports-' + libnm_util_name,
-  check_exports,
-  args: [libnm_util.full_path(), linker_script],
+  command: [check_exports, libnm_util.full_path(), linker_script],
+  depends: libnm_util
 )
 
 sources = files(
diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c
index dfc8ea98..fc8d0318 100644
--- a/libnm-util/nm-param-spec-specialized.c
+++ b/libnm-util/nm-param-spec-specialized.c
@@ -38,7 +38,7 @@ struct _NMParamSpecSpecialized {
 /*****************************************************************************/
 /* _gvalues_compare */
 
-static int _gvalues_compare (const GValue *value1, const GValue *value2);
+static gint _gvalues_compare (const GValue *value1, const GValue *value2);
 
 static gboolean
 type_is_fixed_size (GType type, gsize *tsize)
@@ -54,13 +54,13 @@ type_is_fixed_size (GType type, gsize *tsize)
 		if (tsize) *tsize = sizeof (gboolean);
 		return TRUE;
 	case G_TYPE_LONG:
-		if (tsize) *tsize = sizeof (long);
+		if (tsize) *tsize = sizeof (glong);
 		return TRUE;
 	case G_TYPE_ULONG:
 		if (tsize) *tsize = sizeof (gulong);
 		return TRUE;
 	case G_TYPE_INT:
-		if (tsize) *tsize = sizeof (int);
+		if (tsize) *tsize = sizeof (gint);
 		return TRUE;
 	case G_TYPE_UINT:
 		if (tsize) *tsize = sizeof (guint);
@@ -72,10 +72,10 @@ type_is_fixed_size (GType type, gsize *tsize)
 		if (tsize) *tsize = sizeof (guint64);
 		return TRUE;
 	case G_TYPE_FLOAT:
-		if (tsize) *tsize = sizeof (float);
+		if (tsize) *tsize = sizeof (gfloat);
 		return TRUE;
 	case G_TYPE_DOUBLE:
-		if (tsize) *tsize = sizeof (double);
+		if (tsize) *tsize = sizeof (gdouble);
 		return TRUE;
 	default:
 		return FALSE;
@@ -84,15 +84,15 @@ type_is_fixed_size (GType type, gsize *tsize)
 
 #define FLOAT_FACTOR 0.00000001
 
-static int
+static gint
 _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 {
 	int ret = 0;
 
 	switch (G_VALUE_TYPE (value1)) {
 	case G_TYPE_CHAR: {
-		char val1 = g_value_get_schar (value1);
-		char val2 = g_value_get_schar (value2);
+		gchar val1 = g_value_get_schar (value1);
+		gchar val2 = g_value_get_schar (value2);
 		if (val1 != val2)
 			ret = val1 < val2 ? -1 : val1 > val2;
 		break;
@@ -112,8 +112,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 		break;
 	}
 	case G_TYPE_LONG: {
-		long val1 = g_value_get_long (value1);
-		long val2 = g_value_get_long (value2);
+		glong val1 = g_value_get_long (value1);
+		glong val2 = g_value_get_long (value2);
 		if (val1 != val2)
 			ret = val1 < val2 ? -1 : val1 > val2;
 		break;
@@ -126,8 +126,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 		break;
 	}
 	case G_TYPE_INT: {
-		int val1 = g_value_get_int (value1);
-		int val2 = g_value_get_int (value2);
+		gint val1 = g_value_get_int (value1);
+		gint val2 = g_value_get_int (value2);
 		if (val1 != val2)
 			ret = val1 < val2 ? -1 : val1 > val2;
 		break;
@@ -154,8 +154,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 		break;
 	}
 	case G_TYPE_FLOAT: {
-		float val1 = g_value_get_float (value1);
-		float val2 = g_value_get_float (value2);
+		gfloat val1 = g_value_get_float (value1);
+		gfloat val2 = g_value_get_float (value2);
 		float diff = val1 - val2;
 
 		/* Can't use == or != here due to inexactness of FP */
@@ -164,8 +164,8 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 		break;
 	}
 	case G_TYPE_DOUBLE: {
-		double val1 = g_value_get_double (value1);
-		double val2 = g_value_get_double (value2);
+		gdouble val1 = g_value_get_double (value1);
+		gdouble val2 = g_value_get_double (value2);
 		double diff = val1 - val2;
 
 		if (diff > FLOAT_FACTOR || diff < -FLOAT_FACTOR)
@@ -179,7 +179,7 @@ _gvalues_compare_fixed (const GValue *value1, const GValue *value2)
 	return ret;
 }
 
-static int
+static gint
 _gvalues_compare_string (const GValue *value1, const GValue *value2)
 {
 	const char *str1 = g_value_get_string (value1);
@@ -196,12 +196,12 @@ _gvalues_compare_string (const GValue *value1, const GValue *value2)
 	return strcmp (str1, str2);
 }
 
-static int
+static gint
 _gvalues_compare_strv (const GValue *value1, const GValue *value2)
 {
 	char **strv1;
 	char **strv2;
-	int ret;
+	gint ret;
 	guint i = 0;
 
 	strv1 = (char **) g_value_get_boxed (value1);
@@ -252,10 +252,10 @@ iterate_collection (const GValue *value, gpointer user_data)
 	*list = g_slist_prepend (*list, _gvalue_dup (value));
 }
 
-static int
+static gint
 _gvalues_compare_collection (const GValue *value1, const GValue *value2)
 {
-	int ret;
+	gint ret;
 	guint len1;
 	guint len2;
 	GType value_type = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value1));
@@ -312,7 +312,7 @@ iterate_map (const GValue *key_val,
 
 typedef struct {
 	GHashTable *hash2;
-	int ret;
+	gint ret;
 } CompareMapInfo;
 
 static void
@@ -331,14 +331,14 @@ compare_one_map_item (gpointer key, gpointer val, gpointer user_data)
 		info->ret = 1;
 }
 
-static int
+static gint
 _gvalues_compare_map (const GValue *value1, const GValue *value2)
 {
 	GHashTable *hash1 = NULL;
 	GHashTable *hash2 = NULL;
 	guint len1;
 	guint len2;
-	int ret = 0;
+	gint ret = 0;
 
 	if (dbus_g_type_get_map_key_specialization (G_VALUE_TYPE (value1)) != G_TYPE_STRING) {
 		g_warning ("Can not compare maps with '%s' for keys",
@@ -371,7 +371,7 @@ _gvalues_compare_map (const GValue *value1, const GValue *value2)
 	return ret;
 }
 
-static int
+static gint
 _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2)
 {
 	GValueArray *values1, *values2;
@@ -379,7 +379,7 @@ _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2)
 	GByteArray *addr1, *addr2;
 	guint32 prefix1, prefix2;
 	GByteArray *gw1, *gw2;
-	int ret = 0;
+	gint ret = 0;
 	int i;
 
 	/* IP6 addresses are GValueArrays (see nm-dbus-glib-types.h) */
@@ -429,7 +429,7 @@ _gvalue_ip6_address_compare (const GValue *value1, const GValue *value2)
 	return ret;
 }
 
-static int
+static gint
 _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2)
 {
 	GValueArray *values1, *values2;
@@ -438,7 +438,7 @@ _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2)
 	GByteArray *next_hop1, *next_hop2;
 	guint32 prefix1, prefix2;
 	guint32 metric1, metric2;
-	int ret = 0;
+	gint ret = 0;
 	int i;
 
 	/* IP6 routes are GValueArrays (see nm-dbus-glib-types.h) */
@@ -491,7 +491,7 @@ _gvalue_ip6_route_compare (const GValue *value1, const GValue *value2)
 	return ret;
 }
 
-static int
+static gint
 _gvalues_compare_struct (const GValue *value1, const GValue *value2)
 {
 	/* value1 and value2 must contain the same type since
@@ -508,12 +508,12 @@ _gvalues_compare_struct (const GValue *value1, const GValue *value2)
 	}
 }
 
-int
+gint
 _gvalues_compare (const GValue *value1, const GValue *value2)
 {
 	GType type1;
 	GType type2;
-	int ret;
+	gint ret;
 
 	if (value1 == value2)
 		return 0;
@@ -592,7 +592,7 @@ param_specialized_validate (GParamSpec *pspec, GValue *value)
 	return changed;
 }
 
-static int
+static gint
 param_specialized_values_cmp (GParamSpec *pspec,
                               const GValue *value1,
                               const GValue *value2)
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index a54e93c3..5a9b9634 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -222,7 +222,7 @@ nm_setting_bond_get_option (NMSettingBond *setting,
 static gboolean
 validate_int (const char *name, const char *value, const BondDefault *def)
 {
-	long num;
+	glong num;
 	guint i;
 
 	for (i = 0; i < strlen (value); i++) {
diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c
index c7da1aa4..e51d2c91 100644
--- a/libnm-util/nm-setting-connection.c
+++ b/libnm-util/nm-setting-connection.c
@@ -912,6 +912,7 @@ compare_property (NMSetting *setting,
 	    && g_strcmp0 (prop_spec->name, NM_SETTING_CONNECTION_ID) == 0)
 		return TRUE;
 
+	/* Otherwise chain up to parent to handle generic compare */
 	return NM_SETTING_CLASS (nm_setting_connection_parent_class)->compare_property (setting, other, prop_spec, flags);
 }
 
diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c
index 17a3a871..2cd0bdaf 100644
--- a/libnm-util/nm-setting-dcb.c
+++ b/libnm-util/nm-setting-dcb.c
@@ -75,14 +75,14 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_DCB)
 
 typedef struct {
 	NMSettingDcbFlags app_fcoe_flags;
-	int               app_fcoe_priority;
+	gint              app_fcoe_priority;
 	char *            app_fcoe_mode;
 
 	NMSettingDcbFlags app_iscsi_flags;
-	int               app_iscsi_priority;
+	gint              app_iscsi_priority;
 
 	NMSettingDcbFlags app_fip_flags;
-	int               app_fip_priority;
+	gint              app_fip_priority;
 
 	/* Priority Flow Control */
 	NMSettingDcbFlags pfc_flags;
@@ -161,7 +161,7 @@ nm_setting_dcb_get_app_fcoe_flags (NMSettingDcb *setting)
  *
  * Since: 0.9.10
  **/
-int
+gint
 nm_setting_dcb_get_app_fcoe_priority (NMSettingDcb *setting)
 {
 	g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0);
@@ -209,7 +209,7 @@ nm_setting_dcb_get_app_iscsi_flags (NMSettingDcb *setting)
  *
  * Since: 0.9.10
  **/
-int
+gint
 nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting)
 {
 	g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0);
@@ -241,7 +241,7 @@ nm_setting_dcb_get_app_fip_flags (NMSettingDcb *setting)
  *
  * Since: 0.9.10
  **/
-int
+gint
 nm_setting_dcb_get_app_fip_priority (NMSettingDcb *setting)
 {
 	g_return_val_if_fail (NM_IS_SETTING_DCB (setting), 0);
@@ -665,7 +665,7 @@ check_uint_array (const guint *array,
 }
 
 static gboolean
-check_priority (int val,
+check_priority (gint val,
                 NMSettingDcbFlags flags,
                 const char *prop_name,
                 GError **error)
diff --git a/libnm-util/nm-setting-dcb.h b/libnm-util/nm-setting-dcb.h
index 04863545..2757200e 100644
--- a/libnm-util/nm-setting-dcb.h
+++ b/libnm-util/nm-setting-dcb.h
@@ -130,14 +130,14 @@ NM_AVAILABLE_IN_0_9_10
 NMSetting *       nm_setting_dcb_new                      (void);
 
 NMSettingDcbFlags nm_setting_dcb_get_app_fcoe_flags     (NMSettingDcb *setting);
-int               nm_setting_dcb_get_app_fcoe_priority  (NMSettingDcb *setting);
+gint              nm_setting_dcb_get_app_fcoe_priority  (NMSettingDcb *setting);
 const char *      nm_setting_dcb_get_app_fcoe_mode      (NMSettingDcb *setting);
 
 NMSettingDcbFlags nm_setting_dcb_get_app_iscsi_flags    (NMSettingDcb *setting);
-int               nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting);
+gint              nm_setting_dcb_get_app_iscsi_priority (NMSettingDcb *setting);
 
 NMSettingDcbFlags nm_setting_dcb_get_app_fip_flags      (NMSettingDcb *setting);
-int               nm_setting_dcb_get_app_fip_priority   (NMSettingDcb *setting);
+gint              nm_setting_dcb_get_app_fip_priority   (NMSettingDcb *setting);
 
 /* Priority Flow Control */
 NMSettingDcbFlags nm_setting_dcb_get_priority_flow_control_flags    (NMSettingDcb *setting);
diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h
index 9b8e9464..e2e02398 100644
--- a/libnm-util/nm-setting-private.h
+++ b/libnm-util/nm-setting-private.h
@@ -58,7 +58,7 @@ gboolean _nm_setting_type_is_base_type (GType type);
 guint32 _nm_setting_get_setting_priority (NMSetting *setting);
 GType _nm_setting_lookup_setting_type (const char *name);
 GType _nm_setting_lookup_setting_type_by_quark (GQuark error_quark);
-int _nm_setting_compare_priority (gconstpointer a, gconstpointer b);
+gint _nm_setting_compare_priority (gconstpointer a, gconstpointer b);
 
 gboolean _nm_setting_get_property (NMSetting *setting, const char *name, GValue *value);
 
@@ -113,8 +113,8 @@ NMSettingVerifyResult _nm_setting_verify_deprecated_virtual_iface_name (const ch
                                                                         const char *setting_name,
                                                                         const char *setting_property,
                                                                         GQuark error_quark,
-                                                                        int e_invalid_property,
-                                                                        int e_missing_property,
+                                                                        gint e_invalid_property,
+                                                                        gint e_missing_property,
                                                                         GSList *all_settings,
                                                                         GError **error);
 
diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c
index f835e07f..3cddb3f9 100644
--- a/libnm-util/nm-setting-vlan.c
+++ b/libnm-util/nm-setting-vlan.c
@@ -174,7 +174,7 @@ static PriorityMap *
 priority_map_new_from_str (NMVlanPriorityMap map, const char *str)
 {
 	PriorityMap *p = NULL;
-	char **t = NULL;
+	gchar **t = NULL;
 	guint32 len;
 	guint64 from, to;
 
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index 9147dfe1..c74d2d71 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -270,7 +270,7 @@ _nm_setting_lookup_setting_type_by_quark (GQuark error_quark)
 	return G_TYPE_INVALID;
 }
 
-int
+gint
 _nm_setting_compare_priority (gconstpointer a, gconstpointer b)
 {
 	guint32 prio_a, prio_b;
@@ -321,7 +321,7 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags)
 	property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs);
 
 	hash = g_hash_table_new_full (g_str_hash, g_str_equal,
-	                              g_free, destroy_gvalue);
+	                              (GDestroyNotify) g_free, destroy_gvalue);
 
 	for (i = 0; i < n_property_specs; i++) {
 		GParamSpec *prop_spec = property_specs[i];
@@ -466,7 +466,7 @@ nm_setting_duplicate (NMSetting *setting)
 	return NM_SETTING (dup);
 }
 
-static int
+static gint
 find_setting_by_name (gconstpointer a, gconstpointer b)
 {
 	NMSetting *setting = NM_SETTING (a);
@@ -616,7 +616,7 @@ nm_setting_compare (NMSetting *a,
 {
 	GParamSpec **property_specs;
 	guint n_property_specs;
-	int same = TRUE;
+	gint same = TRUE;
 	guint i;
 
 	g_return_val_if_fail (NM_IS_SETTING (a), FALSE);
@@ -1335,8 +1335,8 @@ _nm_setting_verify_deprecated_virtual_iface_name (const char *interface_name,
                                                   const char *setting_name,
                                                   const char *setting_property,
                                                   GQuark error_quark,
-                                                  int e_invalid_property,
-                                                  int e_missing_property,
+                                                  gint e_invalid_property,
+                                                  gint e_missing_property,
                                                   GSList *all_settings,
                                                   GError **error)
 {
diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h
index d235efbd..1470a69b 100644
--- a/libnm-util/nm-setting.h
+++ b/libnm-util/nm-setting.h
@@ -182,7 +182,7 @@ typedef struct {
 	GObjectClass parent;
 
 	/* Virtual functions */
-	int         (*verify)            (NMSetting  *setting,
+	gint        (*verify)            (NMSetting  *setting,
 	                                  GSList     *all_settings,
 	                                  GError     **error);
 
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index 054d69f4..2af9432f 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -295,8 +295,8 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid)
 
 	g_return_val_if_fail (ssid != NULL, NULL);
 
-	if (g_utf8_validate ((const char *) ssid->data, ssid->len, NULL))
-		return g_strndup ((const char *) ssid->data, ssid->len);
+	if (g_utf8_validate ((const gchar *) ssid->data, ssid->len, NULL))
+		return g_strndup ((const gchar *) ssid->data, ssid->len);
 
 	/* LANG may be a good encoding hint */
 	g_get_charset ((const char **)(&e1));
@@ -311,15 +311,15 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid)
 		g_free (lang);
 	}
 
-	converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e1, NULL, NULL, NULL);
+	converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e1, NULL, NULL, NULL);
 	if (!converted && e2)
-		converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e2, NULL, NULL, NULL);
+		converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e2, NULL, NULL, NULL);
 
 	if (!converted && e3)
-		converted = g_convert ((const char *) ssid->data, ssid->len, "UTF-8", e3, NULL, NULL, NULL);
+		converted = g_convert ((const gchar *) ssid->data, ssid->len, "UTF-8", e3, NULL, NULL, NULL);
 
 	if (!converted) {
-		converted = g_convert_with_fallback ((const char *) ssid->data, ssid->len,
+		converted = g_convert_with_fallback ((const gchar *) ssid->data, ssid->len,
 		                                     "UTF-8", e1, "?", NULL, NULL, NULL);
 	}
 
@@ -330,11 +330,11 @@ nm_utils_ssid_to_utf8 (const GByteArray *ssid)
 		 */
 
 		/* Use the printable range of 0x20-0x7E */
-		char *valid_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@"
+		gchar *valid_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@"
 		                     "ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`"
 		                     "abcdefghijklmnopqrstuvwxyz{|}~";
 
-		converted = g_strndup ((const char *)ssid->data, ssid->len);
+		converted = g_strndup ((const gchar *)ssid->data, ssid->len);
 		g_strcanon (converted, valid_chars, '?');
 	}
 
@@ -491,7 +491,7 @@ nm_utils_gvalue_hash_dup (GHashTable *hash)
 	g_return_val_if_fail (hash != NULL, NULL);
 
 	table = g_hash_table_new_full (g_str_hash, g_str_equal,
-	                               g_free,
+	                               (GDestroyNotify) g_free,
 	                               value_destroy);
 
 	g_hash_table_foreach (hash, value_dup, table);
diff --git a/libnm-util/tests/meson.build b/libnm-util/tests/meson.build
index 49c35a51..cf46ad14 100644
--- a/libnm-util/tests/meson.build
+++ b/libnm-util/tests/meson.build
@@ -7,7 +7,7 @@ deps = [
 
 cflags = common_cflags + [
   '-DNETWORKMANAGER_COMPILATION_TEST',
-]
+] + nm_build_cflags
 
 test = 'test-libnm-linking'