mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
macro: fix assert_cc() fallback
We need two-level macro-expansion, otherwise __LINE__ will not get evaluated.
This commit is contained in:
parent
5476ad087c
commit
b5be11e823
@ -145,7 +145,9 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
|||||||
#if defined(static_assert)
|
#if defined(static_assert)
|
||||||
#define assert_cc(expr) static_assert(expr, #expr)
|
#define assert_cc(expr) static_assert(expr, #expr)
|
||||||
#else
|
#else
|
||||||
#define assert_cc(expr) struct _assert_struct_ ## __LINE__ { char x[(expr) ? 0 : -1]; }
|
#define assert___cc(expr, line) struct _assert_struct_ ## line { char x[(expr) ? 0 : -1]; }
|
||||||
|
#define assert__cc(expr, line) assert___cc((expr), line)
|
||||||
|
#define assert_cc(expr) assert__cc((expr), __LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define assert_return(expr, r) \
|
#define assert_return(expr, r) \
|
||||||
|
Loading…
Reference in New Issue
Block a user