Some platforms define bool
to be the same size as int
. At least older versions of Mac OS X (and likely other RISC BSD ports) were like this. Presumably the code uses bool
arrays with an assumption of efficiency. Doom has been ported to a lot of platforms so it's probably very cagey about such things.
It has to be done at runtime because there is no standard macro specifying sizeof(bool)
, and compile time checks didn't work with non-macro expressions until C++11.