MT#55283 version-guard static_assert

We don't have this available before kernel 5.1

Ref: https://bugs.debian.org/1101804
Change-Id: I4f2f768738d0f53fec28ed3f8e8f577cbc13431e
Reported-by: Andreas Beckmann <anbe@debian.org>
pull/1924/head
Richard Fuchs 4 weeks ago
parent 1526389ab6
commit afc5ac96c2

@ -4,8 +4,11 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
typedef atomic64_t atomic64; typedef atomic64_t atomic64;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)
static_assert(sizeof(atomic64_t) == sizeof(int64_t), "atomic64_t != int64_t"); static_assert(sizeof(atomic64_t) == sizeof(int64_t), "atomic64_t != int64_t");
static_assert(sizeof(atomic_t) == sizeof(int), "atomic_t != int"); static_assert(sizeof(atomic_t) == sizeof(int), "atomic_t != int");
// else: hope for the best
#endif
#else #else
typedef int atomic_t; typedef int atomic_t;
#endif #endif

Loading…
Cancel
Save