Oipo commented on pull request #214:
URL: https://github.com/apache/celix/pull/214#issuecomment-623179786


   Okay, testing it with clang shows that clang follows the spec more strictly. 
All c11 atomic functions should only be done on _Atomic specified variables. 
However, _Atomic is not available in C++. There is a workaround, but you rely 
on the compiler to make it binary-compatible (no guarantees between compiler 
versions)
   
   ```
   #ifdef __cplusplus
   #include <atomic>
   #define CELIX_ATOMIC(type) std::atomic<type>
   #else
   #include <stdatomic.h>
   #define CELIX_ATOMIC(type) _Atomic type
   #endif
   ```
   
   See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 for more info
   
   
   I'm now against using C11 atomics and prefer my original approach, using the 
__atomic builtins.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to