Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The atomics for C and C++ were not entirely functional when using clang. Partly functionality was provided by the
rtapi_atomc.hheader by (re-)defining some parts, but these should come from the compiler's headers (C:<stdatomic.h>and C++:<atomic>). As a consequence, only the copied explicit load/store operations were possible and non of the other atomic operations would be available or function with clang.The main culprit was the misspelling of the
__STDC_VERSION__macro in the rtapi header, missing the trailing underscores and a wrong comparison.Atomics are provided in C11 and newer. This means that the minimum C-compiler support is C11. But this should not be any problem because we already require a very much newer C++20 on the other side.
Some further adjustments were required once the macro got fixed because using atomic operations with clang requires the variables to be marked as actually atomic variables. That meant moving some private internal structures out of public headers into private space, where these variables could be safely marked as being atomic. One boost header needed to be included before rtapi_atomic.h or the boost header would cause problems.