From 17bd284d7339b59fdd497f3d286e60b9b5875bc4 Mon Sep 17 00:00:00 2001
From: Norihiro Watanabe <norihiro.watanabe@ufz.de>
Date: Thu, 25 Oct 2012 23:47:44 +0200
Subject: [PATCH] support MinGW and Cygwin on Windows

---
 BaseLib/MemWatch.cpp | 4 ++--
 BaseLib/MemWatch.h   | 2 +-
 BaseLib/RunTime.cpp  | 6 +++---
 BaseLib/RunTime.h    | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/BaseLib/MemWatch.cpp b/BaseLib/MemWatch.cpp
index 537b127fb06..20a82badef9 100644
--- a/BaseLib/MemWatch.cpp
+++ b/BaseLib/MemWatch.cpp
@@ -12,7 +12,7 @@
 
 #include "MemWatch.h"
 
-#ifndef WIN32
+#ifndef _MSC_VER
 
 namespace BaseLib {
 
@@ -71,4 +71,4 @@ unsigned long MemWatch::getCodeMemUsage () {
 
 } // end namespace BaseLib
 
-#endif // WIN
+#endif // _MSC_VER
diff --git a/BaseLib/MemWatch.h b/BaseLib/MemWatch.h
index d34d29426ed..f3934e90d20 100644
--- a/BaseLib/MemWatch.h
+++ b/BaseLib/MemWatch.h
@@ -13,7 +13,7 @@
 #ifndef MEMWATCH_H_
 #define MEMWATCH_H_
 
-#ifndef WIN32
+#ifndef _MSC_VER
 
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/BaseLib/RunTime.cpp b/BaseLib/RunTime.cpp
index fe517531f49..787b0d9e389 100644
--- a/BaseLib/RunTime.cpp
+++ b/BaseLib/RunTime.cpp
@@ -16,7 +16,7 @@ namespace BaseLib {
 
 void RunTime::start()
 {
-#ifndef _WIN32
+#ifndef _MSC_VER
 	gettimeofday(&_start, 0);
 #else
 	_start = timeGetTime();
@@ -25,7 +25,7 @@ void RunTime::start()
 
 void RunTime::stop()
 {
-#ifndef _WIN32
+#ifndef _MSC_VER
 	gettimeofday(&_stop, 0);
 #else
 	_stop = timeGetTime();
@@ -34,7 +34,7 @@ void RunTime::stop()
 
 double RunTime::elapsed()
 {
-#ifndef _WIN32
+#ifndef _MSC_VER
 	return (_stop.tv_sec + _stop.tv_usec/1000000.0 - (_start.tv_sec + _start.tv_usec/1000000.0));
 #else
 	return (_stop - _start) / 1000.0;
diff --git a/BaseLib/RunTime.h b/BaseLib/RunTime.h
index bfcc113c175..23a5dc43cbb 100644
--- a/BaseLib/RunTime.h
+++ b/BaseLib/RunTime.h
@@ -15,7 +15,7 @@
 
 #include "TimeMeasurementBase.h"
 
-#ifndef _WIN32
+#ifndef _MSC_VER
 #include <sys/time.h>
 #else
 #include <windows.h>
@@ -33,7 +33,7 @@ public:
 	virtual double elapsed();
 	~RunTime() {};
 private:
-#ifndef _WIN32
+#ifndef _MSC_VER
 	timeval _start;
 	timeval _stop;
 #else
-- 
GitLab