--- a/src/lasindex.cpp
+++ b/src/lasindex.cpp
@@ -337,7 +337,7 @@
     name[strlen(name)-2] = 'a';
     name[strlen(name)-1] = 'x';
   }
-#ifdef _MSC_VER
+#ifdef _WIN32
   wchar_t* utf16_name = UTF8toUTF16(name);
   FILE* file = _wfopen(utf16_name, L"rb");
   delete[] utf16_name;
@@ -380,7 +380,7 @@
 
   lasreader->close();
 
-#ifdef _MSC_VER
+#ifdef _WIN32
   wchar_t* utf16_file_name = UTF8toUTF16(file_name);
   FILE* file = _wfopen(utf16_file_name, L"rb");
   if (file == 0)
@@ -450,7 +450,7 @@
   fclose(file);
 
   ByteStreamOut* bytestreamout;
-#ifdef _MSC_VER
+#ifdef _WIN32
   utf16_file_name = UTF8toUTF16(file_name);
   file = _wfopen(utf16_file_name, L"rb+");
   if (file == 0)
@@ -535,7 +535,7 @@
     name[strlen(name)-2] = 'a';
     name[strlen(name)-1] = 'x';
   }
-#ifdef _MSC_VER
+#ifdef _WIN32
   wchar_t* utf16_file_name = UTF8toUTF16(name);
   FILE* file = _wfopen(utf16_file_name, L"wb");
   if (file == 0)
--- a/src/laszip_dll.cpp
+++ b/src/laszip_dll.cpp
@@ -2898,7 +2898,7 @@
 
     // open the file
 
-#ifdef _MSC_VER
+#ifdef _WIN32
     wchar_t* utf16_file_name = UTF8toUTF16(file_name);
     laszip_dll->file = _wfopen(utf16_file_name, L"wb");
     delete [] utf16_file_name;
@@ -4290,7 +4290,7 @@
 
     // open the file
 
-#ifdef _MSC_VER
+#ifdef _WIN32
     wchar_t* utf16_file_name = UTF8toUTF16(file_name);
     laszip_dll->file = _wfopen(utf16_file_name, L"rb");
     delete [] utf16_file_name;
--- a/src/mydefs.hpp
+++ b/src/mydefs.hpp
@@ -256,7 +256,7 @@
   to[7] = from[0];
 }
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 #include <windows.h>
 wchar_t* UTF8toUTF16(const char* utf8);
 #endif
--- a/src/mydefs.cpp
+++ b/src/mydefs.cpp
@@ -30,7 +30,7 @@
 */
 #include "mydefs.hpp"
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 #include <windows.h>
 wchar_t* UTF8toUTF16(const char* utf8)
 {
