eal: update assertion macro
Update RTE_VERIFY macro to make it possible to use complex expressions
in RTE_ASSERT.
Now it’s possible to have % char inside the expression, for example:
RTE_ASSERT((sizeof(some_struct) % 64) == 0)
Before the patch, “%" sign acts like a conversion specification
beginning character.
Fixes: 148f963fb5
("xen: core library changes")
Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
parent
e976052a11
commit
65f88eb284
@ -86,7 +86,7 @@ void rte_dump_registers(void);
|
|||||||
#endif
|
#endif
|
||||||
#define RTE_VERIFY(exp) do { \
|
#define RTE_VERIFY(exp) do { \
|
||||||
if (unlikely(!(exp))) \
|
if (unlikely(!(exp))) \
|
||||||
rte_panic("line %d\tassert \"" #exp "\" failed\n", __LINE__); \
|
rte_panic("line %d\tassert \"%s\" failed\n", __LINE__, #exp); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user