From dfb25b6c4ad03098a28fdb087f31cc014fc357d5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Dec 2014 10:38:46 +0100 Subject: [PATCH] all: move STRLEN() macro to global header nm-utils-internal.h https://bugzilla.gnome.org/show_bug.cgi?id=741651 (cherry picked from commit 422fbf48b94d51d0a874e29b4f82726b1bca0c92) --- include/nm-utils-internal.h | 3 +++ src/NetworkManagerUtils.h | 3 --- src/dhcp-manager/nm-dhcp-dhclient-utils.c | 1 + src/dhcp-manager/tests/test-dhcp-dhclient.c | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/nm-utils-internal.h b/include/nm-utils-internal.h index 69ab8391be..c002b6c1ef 100644 --- a/include/nm-utils-internal.h +++ b/include/nm-utils-internal.h @@ -82,6 +82,9 @@ /********************************************************/ +/* macro to return strlen() of a compile time string. */ +#define STRLEN(str) ( sizeof ("" str) - 1 ) + #define NM_IN_SET(x, y, ...) \ ({ \ const typeof(y) _y = (y); \ diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index a0dab49267..40315c6efc 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -51,9 +51,6 @@ nm_utils_ip6_route_metric_normalize (guint32 metric) int nm_spawn_process (const char *args); -/* macro to return strlen() of a compile time string. */ -#define STRLEN(str) ( sizeof ("" str) - 1 ) - /* check if @flags has exactly one flag (@check) set. You should call this * only with @check being a compile time constant and a power of two. */ #define NM_FLAGS_HAS(flags, check) \ diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c index ec40bbd296..46e8e0b8dc 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c +++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c @@ -32,6 +32,7 @@ #include "nm-platform.h" #include "NetworkManagerUtils.h" #include "gsystem-local-alloc.h" +#include "nm-utils-internal.h" #define CLIENTID_TAG "send dhcp-client-identifier" diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c index 5d360f54e4..4f7e96afde 100644 --- a/src/dhcp-manager/tests/test-dhcp-dhclient.c +++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c @@ -32,6 +32,7 @@ #include "nm-utils.h" #include "nm-ip4-config.h" #include "nm-platform.h" +#include "nm-utils-internal.h" #define DEBUG 1