build: Fix cross-compilation errors.

Tested with mingw-w32-bin_i686-linux_20130523. Building with wineg++ and DirectX (from Wine 1.7.6) with host g++ 4.8.2 also works.