How to determine what value MSVC uses for a preprocessor macro
I'm trying to use the / MS compiler option to compile MSVC6 to define a string, but there is something weird about using double quotes around it. To debug this issue, it would be extremely helpful so that I can see what value the preprocessor is actually replacing my code with where the macro expands. Is there a way to do this? I tried to create a "build and source" listing file, but the source contains the original name of the macro, and ASM is weird gibberish on that line. Is there a way to get the value of a macro at compile time?
If this is not the case (or perhaps more useful), how do I specify a string with the / D option? It should replace my source with double quotes around it since I am using it as a string literal.
source to share
MSVC has a compiler flag that allows you to see the preprocessed source file with all macros, comments removed, etc. - the whole translation unit in terms of the actual code that will be compiled. The preprocessed output should give you the insight you're looking for regarding expanding your macro. More details here .
source to share