Is it at all possible in c/c++ to do something like to following:
#define (_asm int 3;) (exit(1))
So that everywhere in my code this line will be replaced at compile time. I know this is bad practice but is it possible.
cheers
You could do a global search and replace with your programming editor (or IDE) of choice and change _asm int 3
to e.g. FOO
, and then define a macro FOO
like this:
#if 1 // <<<- change this test to determine how `FOO` is expanded
#define FOO _asm int 3
#else
#define FOO exit(1)
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With