[libcxx-commits] [PATCH] D59607: libc++/win: Make once_flag have the same size as a pointer

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 20 12:50:01 PDT 2019

EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

Can you add a description of why this is a problem on Windows?

Comment at: libcxx/include/mutex:583
-    unsigned long __state_;
+    uintptr_t __state_;
Because this change is ABI breaking and can't be done unconditionally, I would create a typedef `_StateType` that's `uintptr_t` on Windows and `unsigned long` everywhere else.

Comment at: libcxx/include/mutex:653
-_LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*));
+_LIBCPP_FUNC_VIS void __call_once(volatile uintptr_t&, void*, void(*)(void*));
This change is ABI breaking because `uintptr_t` isn't always `unsigned long`. On 32 bit platforms it may be `unsigned int`, which mangles differently.



More information about the libcxx-commits mailing list