mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
[libc][NFC] Add a static assert for futex size.
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
#undef _Alignas
|
||||
#define _Alignas alignas
|
||||
|
||||
#undef _Static_assert
|
||||
#define _Static_assert static_assert
|
||||
|
||||
#undef _Alignof
|
||||
#define _Alignof alignof
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ typedef struct {
|
||||
_Alignas(sizeof(unsigned int) > _Alignof(unsigned int)
|
||||
? sizeof(unsigned int)
|
||||
: _Alignof(unsigned int)) unsigned int __word;
|
||||
_Static_assert(sizeof(unsigned int) == 4, "Unexpected size of unsigned int.");
|
||||
#else
|
||||
#error "A type to represent a futex word is not available for the target arch."
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user