Added ifdef checks for Windows build.