utils: move NM_FLAGS_*() macros to header file "include/nm-utils-internal.h"
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user