Seeing expanded C macros

后端 未结 12 1095
清歌不尽
清歌不尽 2020-11-28 05:31

If I want to expand a C macro, what are some good ways to do that (besides tracing it manually)?

For instance, GTK_WIDGET_SET_FLAGS, it uses a macro that

12条回答
  •  鱼传尺愫
    2020-11-28 05:46

    In Visual Studio, you can generate the preprocessor resulted translation unit file. You can go project options, C/C++/Preprocessor and put "Generate Preprocessed File" or "Preprocess to a File" on Yes (or use /P or /EP compiler switch to include line numbers or not).

提交回复
热议问题