mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 09:30:16 +01:00
shared: move NM_SET_OUT() to "nm-std-aux.h"
This commit is contained in:
parent
220825836a
commit
d407c1271c
2 changed files with 16 additions and 14 deletions
|
|
@ -430,20 +430,6 @@ NM_G_ERROR_MSG (GError *error)
|
|||
_n; \
|
||||
})
|
||||
|
||||
/* Note: @value is only evaluated when *out_val is present.
|
||||
* Thus,
|
||||
* NM_SET_OUT (out_str, g_strdup ("hallo"));
|
||||
* does the right thing.
|
||||
*/
|
||||
#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
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _NM_CC_SUPPORT_AUTO_TYPE
|
||||
|
|
|
|||
|
|
@ -174,4 +174,20 @@
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Note: @value is only evaluated when *out_val is present.
|
||||
* Thus,
|
||||
* NM_SET_OUT (out_str, g_strdup ("hallo"));
|
||||
* does the right thing.
|
||||
*/
|
||||
#define NM_SET_OUT(out_val, value) \
|
||||
({ \
|
||||
typeof(*(out_val)) *_out_val = (out_val); \
|
||||
\
|
||||
if (_out_val) { \
|
||||
*_out_val = (value); \
|
||||
} \
|
||||
\
|
||||
(!!_out_val); \
|
||||
})
|
||||
|
||||
#endif /* __NM_STD_AUX_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue