I have this file:
// File.cpp
int main() {
FuncToChange(4, 6, 9, 12);
}
Now, I need to obtain this behaviour:
// Config.h
#define FuncToChange($1, $2, $3, $4) NewFunc($1, $3, $4)
// File.cpp
#include "Config.h"
int main() {
FuncToChange(4, 6, 9, 12);
}
How can I do it without modifying the original “File.cpp” file, i.e. without explicitly #include “Config.h”?
Is it possible to force a header inclusion either from the makefile or from the IDE (CodeBlocks in this case)?
Thank you!
Platform:
CodeBlocks 10.05
GCC/MinGW
Windows 7
From the GCC page on preprocessor options page:
-include file Process file as if #include "file" appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor's working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the #include "..." search chain as normal. If multiple -include options are given, the files are included in the order they appear on the command line.