Fix compile errors under mingw-w64.

To be included in PR #7626.
Merge pull request #6 from narc0tiq/fix-7626

Fix compile errors under mingw-w64.