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
STD Atomic inclusion errors when including in C++ #70
Comments
You could also expand a clause like so: |
I have changed this condition in master a few days ago due to clang on Mac OS, and remove the condition of clang, as in C++, you always have to include <atomic> |
Ok, I will test that. |
I've tested and now I get another (new) kind of warning: Maybe you should use something like |
Fixed by introducing |
It is strange that it go from the C11 stdatomic layer to the emulation layer... It needs to be defined as _Atomic since this layer defines the standard macros. [EDIT]: This analysis is wrong. |
"It needs to be defined as _Atomic since this layer defines the standard macros." |
No, but is it needed for pure C99 compiler. |
I seem not to understand you. |
Well the header shall provide everything the header stdatomic provides. It the system doesn't provide it, it will provide as per the specification of the C11 standard (this is an implementation of the C11 standard for the atomic layer). So that other code includes this header to get access to stdatomic regardless on their system (C99 / C11 / C++). I hope this header to be discarded one day. |
I understand that, but should it actually provide a one-to-one naming, if the entities in this header a system-reserved? Maybe a single level of indirection ( |
I have badly analyzed the warning message (I though it was the emulation layer, but it was the C++ layer). |
Got it! Good job! Gonna check, and write back. |
Still using
clang-cl
under Windows 10.I get the following errors (
error: conflicting types for 'atomic_thread_fence'
and others):The problem here is that your library actually includes the correct C++
<atomic>
but the conditional seems kinda off:The problem here (and it seems you're kinda missing this in general), is that
clang-cl
is BOTH Clang and MSVC and defines BOTH macros. I would again suggest to use those compiler detection macros, provided in a separate issue (with proposal).The text was updated successfully, but these errors were encountered: