diff options
author | Thomas Haller <thaller@redhat.com> | 2015-05-25 11:19:28 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-05-29 16:28:33 +0200 |
commit | dce00f0d1087098cd4b2f27bbb9905e1d6c450d9 (patch) | |
tree | efcfa60ea86ba111793c4afead4d698394933307 | |
parent | 2297333bb15b4df1e27eab447552ea469dcd859b (diff) | |
download | NetworkManager-dce00f0d1087098cd4b2f27bbb9905e1d6c450d9.tar.gz |
utils: move NM_FLAGS_*() macros to header file "include/nm-utils-internal.h"
-rw-r--r-- | include/nm-utils-internal.h | 10 | ||||
-rw-r--r-- | src/NetworkManagerUtils.h | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/include/nm-utils-internal.h b/include/nm-utils-internal.h index 06d5d06357..82c89dcc63 100644 --- a/include/nm-utils-internal.h +++ b/include/nm-utils-internal.h @@ -181,4 +181,14 @@ nm_clear_g_source (guint *id) /*****************************************************************************/ +/* 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) \ + ( (G_STATIC_ASSERT_EXPR ( ((check) != 0) && ((check) & ((check)-1)) == 0 )), (NM_FLAGS_ANY ((flags), (check))) ) + +#define NM_FLAGS_ANY(flags, check) ( ( ((flags) & (check)) != 0 ) ? TRUE : FALSE ) +#define NM_FLAGS_ALL(flags, check) ( ( ((flags) & (check)) == (check) ) ? TRUE : FALSE ) + +/*****************************************************************************/ + #endif diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 8749d32135..3c14212ed8 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -53,15 +53,6 @@ int nm_spawn_process (const char *args, GError **error); int nm_utils_modprobe (GError **error, const char *arg1, ...) G_GNUC_NULL_TERMINATED; -/* 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) \ - ( (G_STATIC_ASSERT_EXPR ( ((check) != 0) && ((check) & ((check)-1)) == 0 )), (NM_FLAGS_ANY ((flags), (check))) ) - -#define NM_FLAGS_ANY(flags, check) ( ( ((flags) & (check)) != 0 ) ? TRUE : FALSE ) -#define NM_FLAGS_ALL(flags, check) ( ( ((flags) & (check)) == (check) ) ? TRUE : FALSE ) - - /** * str_if_set: * @str: input string that will be returned if @str is not %NULL |