Is it possible to create a custom compiler directive in Swift?

Viewed 142

Imagine you don't want to enable GCC_TREAT_WARNINGS_AS_ERRORS. Because you are working on an epic legacy code and you don't want to make all 999+ warnings to be errors! But we want it for some cases:

#if DEBUG
#warning("Change this on production")
#else
#error("Change this on production")
#endif

Is there a way to create a custom one? For example something like:

#criticalWarning("Show correct message for errors") 
0 Answers
Related