munt/munt — pull request #21 by lordhoto (2014-07-10 21:10:06+00:00)
Title: Do not rely on global constructors.

This makes sure that no global constructors are required to run in the main
MUNT code. Global constructors have an implementation specific execution
order/time. There are only some minimal guarantees by the C++ standard.

In ScummVM these can be an issue for some obscure platforms because they might
not even get executed at all. This is not standard conforming but the reason
we disallow code with global constructors.

The change is not exactly pretty since it removes the visibility control of
ControlROMFeatureSet. I am not sure whether this data type is going to be
extended in the future or not. If it isn't, it might be possible to just
replace it directly with a boolean value.

clang's -Wglobal-constructors warning option allows to check whether global
constructors are used.

This change is really mainly motivated by our coding rules in ScummVM. There shouldn't be any issue for platforms with standard compliant construction since all uses of it are in the same translation code as the functions accessing it. Thus, it might be that you simply not care about it. In this case we will make a similar change local to our copy of MUNT. Any thoughts are welcome though.