-
Notifications
You must be signed in to change notification settings - Fork 5.4k
atomic.h
: Add C11 implmentation of atomic operations
#13799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do you mean Solaris by Oracle here? |
I used Oracle to describe whatever compiler that evals Edit:
cpredef/predef claims Solaris, SunOS and illumos Should I change it to Solaris? |
At least illumos is based on OpenSolaris and not owned by Oracle. |
If
|
I haven't said that Solaris is not preferable, at all, and the word Solaris is not in your commit log. |
Sorry for the confusion, reworded and rebased. |
727c4f0
to
ea5a308
Compare
These branches are only active for 32-bit Windows and Solaris platforms, codify the fact by changing `#else` to `#elif`'s that explicitly include those targets and `#error`-out otherwise.
The implementation is only active if `HAVE_STDATOMIC_H` is defined, and only after the compiler fails to match all currently supported systems.
Introduce an implementation of atomic operations with C11 _Atomic qualifier and <stdatomic.h> functions. This allows C compilers relying on C11 model as the sole atomic interface to compile Ruby. The existing configure definition
HAVE_STDATOMIC_H
is used as the feature switch.To be as non-intrusive as possible, new
#elif
blocks are consistently positioned right before#error
, all currently supported systems are expected to be unaffected by the change, that is, no additional#include
or library dependency or raising of-std
version.Several
#else
branches that were only used for 32-bit Windows and Oracle platforms are changed to explicit#elif Win || Oracle
to maintain a consistent order of implementation branches.