Define AMD64 for 64-bit mingw.
Fix cast error.
Fix using function pointer