How do I get the preprocessed output of a header file?
I have a header file where I used:
#if defined(LINUX) || defined(ANDROID)
pthread_t gpthread;
#endif
Now I would like to get only the content of the header file after passing -DLINUX in compilation. Is there a way to get it? If I use:
#arm-linux-androideabi-g++ -E main.c > temp
then the conclusion confuses me a little.
+3
source to share
3 answers
You might be interested in keeping the comments in the preprocessed output (for better readability) with
arm-linux-androideabi-g++ -DLINUX -C -E foo.h > foo.i
then look (with editor or pager) in foo.i
The generated one foo.i
contains lines starting with #
to convey location information.
+2
source to share