Skip class / methods that are not defined?

What do you mean "within code"? You would just be using the same type of macro sequences to select the proper calls within a function rather than for selecting which global variables to define. But it's still the preprocessor ... not the compiler and not at runtime.