Wednesday, October 13, 2004

Having Fun with _MACRO's?

A useful tool when unravelling the expanded mess that is a C++ macro is to use the Visual Studio /P option( select the file->Properties->C/C++->Preprocessor->Generate Processed File).
This puts a YourFileName.i file in the source code folder that contains all of the preprocessed text that is subsequently used to generate the *.obj file including expanded macros.
Very handy when you are trying to understand a macro that uses a macro that uses a macro.....

No comments: