[libc-commits] [PATCH] D135408: [libc] fix futex type

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Oct 6 15:19:52 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf2a99746666e: [libc] fix futex type (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135408/new/

https://reviews.llvm.org/D135408

Files:
  libc/include/llvm-libc-types/__futex_word.h


Index: libc/include/llvm-libc-types/__futex_word.h
===================================================================
--- libc/include/llvm-libc-types/__futex_word.h
+++ libc/include/llvm-libc-types/__futex_word.h
@@ -10,16 +10,11 @@
 #define __LLVM_LIBC_TYPES_FUTEX_WORD_H__
 
 typedef struct {
-#if defined(__unix__) && (defined(__x86_64__) || defined(__aarch64__))
   // Futex word should be aligned appropriately to allow target atomic
   // instructions. This declaration mimics the internal setup.
-  _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
+  _Alignas(sizeof(__UINT32_TYPE__) > _Alignof(__UINT32_TYPE__)
+               ? sizeof(__UINT32_TYPE__)
+               : _Alignof(__UINT32_TYPE__)) __UINT32_TYPE__ __word;
 } __futex_word;
 
 #endif // __LLVM_LIBC_TYPES_FUTEX_WORD_H__


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135408.465900.patch
Type: text/x-patch
Size: 1081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221006/6ade59a4/attachment.bin>


More information about the libc-commits mailing list