[libc][NFC] Add a static assert for futex size.

This commit is contained in:
Siva Chandra Reddy
2022-03-01 22:53:46 +00:00
parent d75ac58117
commit 32a50c6b93
2 changed files with 4 additions and 0 deletions

View File

@@ -23,6 +23,9 @@
#undef _Alignas
#define _Alignas alignas
#undef _Static_assert
#define _Static_assert static_assert
#undef _Alignof
#define _Alignof alignof

View File

@@ -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