Patched to compile with MingW64 on case-sensitive systems (thanks, Martin!).

Fixes Bugzilla #2440.