--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@
 
 project(cerf LANGUAGES NONE)
 if (CERF_C)
-    if(WIN32)
+    if(MSVC)
         message(FATAL_ERROR "Compilation as C not supported by MSVC, use -DCERF_C=OFF")
     endif()
     enable_language(C)
--- a/lib/cerf.h
+++ b/lib/cerf.h
@@ -52,7 +52,7 @@
      typedef std::complex<double> _cerf_cmplx;
 #  else
 #    include <complex.h>
-#    if _WIN32
+#    ifdef _MSC_VER
 #      error Compilation under C not supported by MSVC (arithmetic operators missing)
 #    endif
      typedef double complex _cerf_cmplx;
