mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
VIR_REQUIRE_FLAG_(GOTO|RET): Add parens around arguments in expansion
Make the macro useful also for cases when one of multiple flags is required. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d43513e383
commit
21a9be4412
@ -374,7 +374,7 @@
|
||||
*/
|
||||
#define VIR_REQUIRE_FLAG_RET(FLAG1, FLAG2, RET) \
|
||||
do { \
|
||||
if ((flags & FLAG1) && !(flags & FLAG2)) { \
|
||||
if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
|
||||
virReportInvalidArg(ctl, \
|
||||
_("Flag '%s' is required by flag '%s'"), \
|
||||
#FLAG2, #FLAG1); \
|
||||
@ -396,7 +396,7 @@
|
||||
*/
|
||||
#define VIR_REQUIRE_FLAG_GOTO(FLAG1, FLAG2, LABEL) \
|
||||
do { \
|
||||
if ((flags & FLAG1) && !(flags & FLAG2)) { \
|
||||
if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
|
||||
virReportInvalidArg(ctl, \
|
||||
_("Flag '%s' is required by flag '%s'"), \
|
||||
#FLAG2, #FLAG1); \
|
||||
|
Loading…
x
Reference in New Issue
Block a user