Undocumented Swift conditional compilation macros

swift/lib/Basic/LangOptions.cpp has most of the conditional compilation macros (called “Language Options” in the compiler internally).  Notably the swift() version macro is absent, and doesn’t seem to be defined anywhere…

At time of writing the two undocumented additions, to the os(), arch(), and swift() set, are _endian() and _runtime().

I have no idea if they’re useful or not – does anyone have to care about CPU endianness these days, really? – but there they are.

Leave a Comment