summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-08-18 16:10:38 +0200
committerThomas Haller <thaller@redhat.com>2015-10-06 14:19:30 +0200
commit083982371bf191d9c69515e1dbeda488dc014814 (patch)
tree4e560e887f8651fdf4450de0963017b2338c48b3
parentad3577b3acef8207d26f5117dd2aee9bbf4a0882 (diff)
downloadNetworkManager-083982371bf191d9c69515e1dbeda488dc014814.tar.gz
macros: add NM_SET_OUT() macro
-rw-r--r--include/nm-macros-internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h
index 0bf25821ad..d12690048f 100644
--- a/include/nm-macros-internal.h
+++ b/include/nm-macros-internal.h
@@ -109,6 +109,15 @@
/* macro to return strlen() of a compile time string. */
#define STRLEN(str) ( sizeof ("" str) - 1 )
+#define NM_SET_OUT(out_val, value) \
+ G_STMT_START { \
+ typeof(*(out_val)) *_out_val = (out_val); \
+ \
+ if (_out_val) { \
+ *_out_val = (value); \
+ } \
+ } G_STMT_END
+
/********************************************************/
#define _NM_IN_SET_EVAL_1(op, x, y1) \