Is this possible?
Basically, what I want to do is something like this:
#includeIfItExists "header.h"
and if header.h does not exist, the compiler simply continues on its merry way.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m by no means an expert C guy but I don’t believe that this is possible natively. I think the recommend route would be to pass in a named macro at the compiler level using
-Dand if it is (or possibly is not) defined perform your include. This way the person compiling the program has to make a conscious decision to skip the include (or include it).