Is there a reason to use builtins rather than the C11 \<stdatomic.h\> functions?
Yeah I chose builtins for a few reasons: * I didn't know what the policy of using C11 in general in wine is, or `<stdatomic.h>`. * It is also not used in wines codebase at all, whereas __atomic builtins are used commonly * C11 atomics are implemented on top of these builtins (and any version of gcc/clang that supports C11, also supports them, so nothing compatibility wise is gained here) * They also produce identical machine code * C11 requires `_Atomic` types as well, so it would be a more invasive change Apart from Apple's inline helpers using the C11 version, the only other reason I can think of using them is: * Works across outside the clang/gcc ecosystem (which IMO is a moot point here) * Maybe looks prettier * Better compile time type checking for atomic access etc via `_Atomic`
Also I think it would be best to transition to new functions and then relax barriers in separate commits.
Yeah makes sense, the latest version does so now. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10463#note_134213