Initial support for C++ in gamecode, currently only compiles with -fpermissive
Make the gamelogic compile in C++

Involves a lot of casts, it could have been done in a smarter way, sometimes.
Merge branch 'master' into engine-upgrade/c++game

Conflicts:
	src/gamelogic/cgame/cg_consolecmds.c
	src/gamelogic/cgame/cg_draw.c
	src/gamelogic/game/g_active.c
	src/gamelogic/game/g_buildable.c
	src/gamelogic/game/g_cmds.c
	src/gamelogic/game/g_confidence.c
	src/gamelogic/game/g_weapon.c
We don't want -fpermissive when compiling C code – gcc complains.
Remove -fpermissive, was used for before d3278daba5d925b2 (Make the gamelogic compile in C++)
One more -fpermissive fix.
Fix possible undefined behaviour on deletion due to non-virtual destructor.
Const correctness.
Fix a possible buffer overflow: mbstowcs takes character, not byte, count.
Replace hard-wired sizes with sizeof().
Replace MIN and MAX with std::min and std::max where possible.
Native VM code entry points need C linkage.
Rename syscall → syscallVM.

This should avoid compilation failures on some systems.
Merge branch 'master' into engine-upgrade/c++
Get rid of Q_bound() and add Maths.h.
Fix a naming error.
Get rid of Q_clamp where possible.
CM: Remove unused BSPC and CAPSULE_DEBUG code
Some windows fixes
Fix a type (found by Gallaecio)