--- a/libupnpp/upnpplib.cxx
+++ b/libupnpp/upnpplib.cxx
@@ -505,7 +505,7 @@
     }
 }
 
-#ifdef WIN32
+#ifdef _MSC_VER
 // Note: struct timespec is defined by pthread.h (from pthreads-w32)
 #ifndef CLOCK_REALTIME
 #define CLOCK_REALTIME 0