I want to check if a certain structure was defined in a header file I included and define it if it is not. The header might, or might not be included in the source file and that is (obviously) known at compile time.
Essentially I want something similar to the ifndef
guards used in header files and I know that I could use a check if the header file where the struct
is defined is included by checking it's guard, but I am wandering if I could check for the struct
itself.
No. The preprocessor doesn't parse the C language itself, it knows nothing of the declared types.
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