I have a question regarding the include files.
Suppose you are using a define coming from windows headers. Of course, you can know what is the exact header which defines the macro. But the question is can we get the include
chain and know which path causes the macro to be included?
E.g. I have the following structure
windows.h // a windows header defines a macro
header1.h <- windows.h // a <- b means a includes b
header2.h <- windows.h
header3.h <- windoes.h
header4.h <- header1.h, header2.h
header5.h <- header1.h, header4.h, header3.h
As you would expect, the real example can be a lot complicated with tones of macro definitions and ifdef
s.
Now in our example.cpp
we #include "header4.h"
or #include "header5.h"
or both together ant we use the macro in windows.h
in our code. How to know what is the include chain?
E.g. for this example it could be header4.h - header1.h - windows.h