Hacker News new | ask | show | jobs
by jwlake 80 days ago
did they ever add #define? bridging constants from the build system to swift with static NSString * const kConstValue = @XSTR(CONST_VALUE); is soooo annoying.
1 comments

Only integers for #defines in C-headers, enabled with a recent-ish compiler flag. Swift has a #define but it’s just an ifdef list of flags assigned to one compiler setting.

But you can bridge build setting variables using some clever xcconfig macros that combine both preprocessor systems.