문제

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.

도움이 되었습니까?

해결책

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 -D and 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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top