Working on it... will take a while.
These two errors are my fault, and you can get rid of them in the mean time by uncommenting the #includes again.
But while being at it, I am doing a few other changes too. Currently, we are including a lot of files a lot of times, although not necessary. Since there are header guards, this does of course not mean the compiler has to process them all, but still... the preprocessor must parse them, and they are read from disk many times.
Yes I know there is this thing called disk cache, but caches have finite sizes, and even if something is in the cache, it does not mean you can access it 10,000 times at no cost...
Maybe the savings will be insignificant, but it might as well be that they are not, we will see
To explain further, we have three possible scenarios:1. Using PCH with a compiler that supports PCHThis will honour the (precompiled) file
sdk_precomp.h, and actually it should end here.
Instead, we are reading in half a dozen or more headers per source file which are all discarded after the preprocessor has seen them.
2. Not using PCH (compiler doesn't matter)sdk_precomp.h is read in for every source, but since
CB_PRECOMP is not defined, most of it will be dead-stripped by the preprocessor. After that, the individual files needed by every source are included and parsed (and some are missing sometimes, see above).
3. Using PCH, but the compiler does not really support itNow this one is a real disaster, and unluckily it is not uncommon, either. First, every source reads in and interpretes
sdk_precomp.h (following all includes therein), and then, it reads in the individual includes in addition. Of course none of them get beyond the preprocessor stage, but they are nevertheless read in (we are talking about a per-source overhead of ~500 includes here).
Thus, my solution is to:1. Add a condition to
sdk_precomp.h which undefines
CB_PRECOMP if the compiler does not support it.
2. Since we can now safely rely that we don't need to include individual headers which are already in
sdk_precomp.h if
CB_PRECOMP is set, put an
#ifndef/
#endif block around these in the sources. That will prevent the headers from being loaded when they would be discarded anyway.