You can use the #ifdef and #ifndef preprocessor directives to check whether a symbol has been defined (#ifdef) or whether it has not been defined (#ifndef).
If you have the better answer, then send it to us. We will display your answer after the approval.