uchar.h file not found on OS X 10.9

c, c11, clang

Solution

Apple's macOS (up to and including Ventura 13.3) has neither `<uchar.h>` nor `<threads.h>`. It doesn't have the 4 functions declared in `<uchar.h>` or any other functions using `char16_t` or `char32_t`.

Code ported to a Mac that needs those facilities must either be rewritten to avoid using them (at least on macOS) or be supported by conditionally compiled code that provides the facilities it needs on macOS.

Problem

I'm under the impression my C compiler supports C11 since it accepts the -std=c11 flag, ``` $ cc --version Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.3.0 Thread model: posix ``` and `uchar.h` is part of the C11 standard, so I'd expect this program to compile, ``` $ cat /tmp/esc.c #include <uchar.h> int main(void) {} ``` But ``` $ cc /tmp/esc.c /tmp/esc.c:1:10: fatal error: 'uchar.h' file not found #include <uchar.h> ^ 1 error generated. ``` I tried locating the uchar.h file, but the only hits on my system are from iPhone SDK's weirdly, ``` $ locate uchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/include/unicode/uchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/unicode/uchar.h ``` How can I use `uchar.h` on OS X 10.9? Am I going to have to download a new compiler, or am I misusing the one I have?

Original source