The example posted prevents this optimisation; |
The multiple include optimization (adding the file name to the compiler's list of 'already processed' files) is specifically invoked via the #pragma directive, and in the case of the GCC, the #ifndef also.
The no-token requirement exists to guarantee that the #ifndef functions at the same scope as the #pragma directive.
That is,
they both do the same thing, and elicit the same behavior from the GCC. So unless the GCC people have taken effort to do something weird to break that (and I wouldn't put it past them, honestly), then the example posted above behaves identically for not just the GCC, but
all compilers that implement MIO. (It should perform identically for the GCC as well. But even if it doesn't, any performance drop is
miniscule compared to actually opening a file and reading the first few tokens.)
The posted example covers every standard-conforming compiler in existence, not just the GCC, where the only noticeable performance problems are in compilers that don't actually perform MIO.