Fix msvc build

Fix building using MSVC after the x86 code reshuffling and after adding support for building DLLs.