diff -Naur cereal-1.2.2/include/cereal/archives/json.hpp cereal-1.2.2-patched/include/cereal/archives/json.hpp
--- cereal-1.2.2/include/cereal/archives/json.hpp	2017-02-13 01:06:58.000000000 +0300
+++ cereal-1.2.2-patched/include/cereal/archives/json.hpp	2018-10-23 22:38:05.621656900 +0300
@@ -661,7 +661,7 @@
 
       // Special cases to handle various flavors of long, which tend to conflict with
       // the int32_t or int64_t on various compiler/OS combinations.  MSVC doesn't need any of this.
-      #ifndef _MSC_VER
+      #if not defined(_MSC_VER) && not defined(__MINGW32__)
     private:
       //! 32 bit signed long loading from current node
       template <class T> inline
diff -Naur cereal-1.2.2/unittests/CMakeLists.txt cereal-1.2.2-patched/unittests/CMakeLists.txt
--- cereal-1.2.2/unittests/CMakeLists.txt	2017-02-13 01:06:58.000000000 +0300
+++ cereal-1.2.2-patched/unittests/CMakeLists.txt	2018-10-23 22:45:34.970358200 +0300
@@ -11,7 +11,7 @@
 if(NOT SKIP_PORTABILITY_TEST)
   # Build the portability test only if we are on a 64-bit machine (void* is 8 bytes)
   if((${CMAKE_SIZEOF_VOID_P} EQUAL 8))
-    if(NOT MSVC)
+    if(NOT WIN32)
       add_executable(portability_test32 portability_test.cpp)
       target_link_libraries(portability_test32 ${CEREAL_THREAD_LIBS})
       set_target_properties(portability_test32 PROPERTIES COMPILE_FLAGS "-m32")
@@ -26,7 +26,7 @@
               -DPORTABILITY_TEST_DIR=$<TARGET_FILE_DIR:portability_test64>
             -P "${CMAKE_CURRENT_SOURCE_DIR}/run_portability_test.cmake")
 
-  elseif(MSVC)
+  elseif()
     add_executable(portability_test32 portability_test.cpp)
     target_link_libraries(portability_test32 cereal::cereal)
   endif()
@@ -48,7 +48,7 @@
     add_test(NAME "${TEST_TARGET}" COMMAND "${TEST_TARGET}")
 
     # If we are on a 64-bit machine, create an extra 32-bit version of the test if portability testing is enabled
-    if((NOT MSVC) AND (${CMAKE_SIZEOF_VOID_P} EQUAL 8) AND (NOT SKIP_PORTABILITY_TEST))
+    if((NOT WIN32) AND (${CMAKE_SIZEOF_VOID_P} EQUAL 8) AND (NOT SKIP_PORTABILITY_TEST))
       add_executable(${TEST_TARGET}_32 ${TEST_SOURCE})
       set_target_properties(${TEST_TARGET}_32 PROPERTIES
         COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
@@ -61,7 +61,7 @@
 endforeach()
 
 # Add the valgrind target
-if(NOT MSVC)
+if(NOT WIN32)
   add_custom_target(valgrind
     COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/run_valgrind.sh")
 
diff -Naur cereal-1.3.0/unittests/boost/CMakeLists.txt cereal-1.3.0-patched/unittests/boost/CMakeLists.txt
--- cereal-1.3.0/unittests/boost/CMakeLists.txt	2020-06-11 01:06:58.000000000 +0300
+++ cereal-1.3.0-patched/unittests/boost/CMakeLists.txt	2020-06-11 22:45:34.970358200 +0300
@@ -14,7 +14,7 @@
   add_test(NAME "${TEST_TARGET}" COMMAND "${TEST_TARGET}")
 
   # If we are on a 64-bit machine, create an extra 32-bit version of the test if portability testing is enabled
-  if((NOT MSVC) AND (${CMAKE_SIZEOF_VOID_P} EQUAL 8) AND (NOT SKIP_PORTABILITY_TEST))
+  if((NOT WIN32) AND (${CMAKE_SIZEOF_VOID_P} EQUAL 8) AND (NOT SKIP_PORTABILITY_TEST))
     add_executable(${TEST_TARGET}_32 ${TEST_SOURCE})
     target_link_libraries(${TEST_TARGET}_32 ${CEREAL_THREAD_LIBS})
     set_target_properties(${TEST_TARGET}_32 PROPERTIES
@@ -24,7 +24,7 @@
 
 endforeach()
 
-if(NOT MSVC)
+if(NOT WIN32)
   # add tests to coverage
   foreach(TEST_SOURCE ${TESTS})
     string(REPLACE ".cpp" "" COVERAGE_TARGET "${TEST_SOURCE}")
