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:
Hans Petter Selasky 2018-02-17 08:12:35 +00:00
parent 3fa2c0489b
commit af4010be77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329447

View File

@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new)
#define cmpxchg(ptr, old, new) ({ \
union { \
__typeof(*(ptr)) val; \
u8 u8[]; \
u16 u16[]; \
u32 u32[]; \
u64 u64[]; \
u8 u8[0]; \
u16 u16[0]; \
u32 u32[0]; \
u64 u64[0]; \
} __ret = { .val = (old) }, __new = { .val = (new) }; \
\
CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \