macros: add NM_SET_OUT() macro

(cherry picked from commit d4d2e65eb7)
This commit is contained in:
Thomas Haller 2015-08-18 16:10:38 +02:00 committed by Francesco Giudici
parent 70c0defe75
commit a72dd80a94

View file

@ -111,6 +111,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) \