Seems like Xcode 5 and higher supports C11 but when I try to include stdatomic.h it says it can not find the file? Is it possible to use C11 atomic structures in Xcode?
Asked
Active
Viewed 2,712 times
8
-
2Xcode use clang and clang seems to support C11 atomics which means it has the needed intrinsic functions and type attributes. However, the stdatomic.h file is missing. People from the FreeBSD project wrote their own, and projets like newlib just uses it. See [link](https://github.com/eblot/newlib/blob/master/newlib/libc/include/stdatomic.h). I would be more confident if this file would come with the compiler. How to confirm that working with it generates the right code on all architectures used by OS-X and iOS? – Gabriele Mondada Nov 01 '14 at 22:06
-
Thanks! Yeah I wish Apple would properly support this feature in the near future – bitwise Nov 04 '14 at 01:05
-
2Since October 2, 2014, clang has its own stdatomic.h. See [related commit](http://llvm.org/viewvc/llvm-project?view=revision&revision=218957). – Gabriele Mondada Jan 01 '15 at 21:17
-
3As of clang 3.6, this compiler still isn't standard conforming to C11 because of this. Either it would have to provide the head or set the corresponding feature macro. – Jens Gustedt Feb 28 '15 at 17:44
1 Answers
2
stdatomic.h
is available in Xcode 7 and later.
The MacOS 10.12 SDK adds stdatomic.h
to its module map opening up availability to the Swift compiler as well.

Cinder Biscuits
- 4,880
- 31
- 51