Compile fix for GCC in the LinuxKPI.
Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies
This commit is contained in:
parent
3fa2c0489b
commit
af4010be77
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329447
@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new)
|
|||||||
#define cmpxchg(ptr, old, new) ({ \
|
#define cmpxchg(ptr, old, new) ({ \
|
||||||
union { \
|
union { \
|
||||||
__typeof(*(ptr)) val; \
|
__typeof(*(ptr)) val; \
|
||||||
u8 u8[]; \
|
u8 u8[0]; \
|
||||||
u16 u16[]; \
|
u16 u16[0]; \
|
||||||
u32 u32[]; \
|
u32 u32[0]; \
|
||||||
u64 u64[]; \
|
u64 u64[0]; \
|
||||||
} __ret = { .val = (old) }, __new = { .val = (new) }; \
|
} __ret = { .val = (old) }, __new = { .val = (new) }; \
|
||||||
\
|
\
|
||||||
CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \
|
CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \
|
||||||
|
Loading…
Reference in New Issue
Block a user