Closed locodarwin closed 2 years ago
I wanted to write a page about this in the docs but never had the time. So in short, there's GPP, a generic preprocessor that can be used with XC=BASIC code as well:
https://math.berkeley.edu/~auroux/software/gpp.html
Could even tie some definitions to command line arguments, such as "--target=", so that preprocessing can switch between cases without altering the source code.
Yeah, GPP can do that, too.
Now that XC=BASIC is supporting multiple Commodore architectures, it would be useful to have preprocessor directives such as #define, #if, #else, and the like. This would allow single XC=BASIC source code files/modules to support multiple compile targets, for example. Consider the following example:
Could even tie some definitions to command line arguments, such as "--target=", so that preprocessing can switch between cases without altering the source code.