I want to find a library for preprocessing c files with following features:
- process defines
- process includes
Small example of what I want:
input
some_file.h
some_code
main.c
#if SOME_DEFINE == TRUE
#inlcude "some_file.h"
#else
#endif
...
output (with SOME_DEFINE = TRUE) main.c
some_code
...
It seems that boost::wave fits perfectly for it. However I want something more: virtual file system for include files. So preprocessor will get include files from virtual file system in memory, and not from hdd. I need this to have faster preprocessing in situation when I have to preprocess same file with a lot of different defines.
So the question: does there exist a library like boost::wave, but with support for virtual file system? Or mayby boost::wave supports it somehow?
Here is snipped for hooking file loading in boost::wave (version 1.53)