SpacemanDMM
SpacemanDMM copied to clipboard
Duplicate #includes should not duplicate parsing
Currently, we get "duplicate definition" errors from the parser when a file gets included multiple times, indicating that the file is actually being parsed at every #include
of it, which is not how compilation works:
http://www.byond.com/docs/ref/index.html#/DM/preprocessor/include
If a file is included multiple times, only the first occurrence will be processed.
One workaround (only needed for parsing, not compilation):
// top of file
#ifndef WHATEVER_FILE
#define WHATEVER_FILE
// code goes here
#endif
// end of file
I think this was the true issue behind #97, rather than the warning itself.
As far as I can tell this is implemented. Can you provide a test project that demonstrates the problem?