In my project, depending on the target some definitions should expand to nothing instead of a number.
I would like that if a const defined as a unit type generated an empty define:
const MYCONST: () = () —> #define MYCONST
Currently I'm using a hack, since I do have a header that are included on all other headers, I create a manual #define None and make the const equal to None. That in turns generate #define [NAME] None, in the grand scheme of things, C preprocessor expand to nothing, as expected. But would be nice to have something easier and less hacky.
In my project, depending on the target some definitions should expand to nothing instead of a number.
I would like that if a
const
defined as a unit type generated an empty define:const MYCONST: () = ()
—>#define MYCONST
Currently I'm using a hack, since I do have a header that are included on all other headers, I create a manual
#define None
and make the const equal toNone
. That in turns generate#define [NAME] None
, in the grand scheme of things, C preprocessor expand to nothing, as expected. But would be nice to have something easier and less hacky.