Is it possible to programmatically determine (and print) where the C ++ header was included from?
I have a headline like:
// DeprecatedHeader.h __pragma( message ("DeprecatedHeader.h is deprecated - include NewHeader.h instead.") )
As you can see, the compiler is MSVC, but I have macros to port. GCC is welcome, but if this is not possible, I would enable the "trick" only on Windows.
But I am looking for a result, for example
"AnyOtherFile.cpp was including DeprecatedHeader.h, please include NewHeader.h instead."
Change To be clear why I want this: the warning that the compiler generates already helps a lot: the code is not broken, but causes people to change the include. Problem: He could blame the wrong βguyβ as you could pull this heading through a different heading. My goal was to blame the error header, not the compilation unit.
source share