[PATCH 01/14] src: Tweak source code to allow C++ compilation