Skip to content
Snippets Groups Projects
Commit 17bd284d authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

support MinGW and Cygwin on Windows

parent f5c1a5d3
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "MemWatch.h" #include "MemWatch.h"
#ifndef WIN32 #ifndef _MSC_VER
namespace BaseLib { namespace BaseLib {
...@@ -71,4 +71,4 @@ unsigned long MemWatch::getCodeMemUsage () { ...@@ -71,4 +71,4 @@ unsigned long MemWatch::getCodeMemUsage () {
} // end namespace BaseLib } // end namespace BaseLib
#endif // WIN #endif // _MSC_VER
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifndef MEMWATCH_H_ #ifndef MEMWATCH_H_
#define MEMWATCH_H_ #define MEMWATCH_H_
#ifndef WIN32 #ifndef _MSC_VER
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -16,7 +16,7 @@ namespace BaseLib { ...@@ -16,7 +16,7 @@ namespace BaseLib {
void RunTime::start() void RunTime::start()
{ {
#ifndef _WIN32 #ifndef _MSC_VER
gettimeofday(&_start, 0); gettimeofday(&_start, 0);
#else #else
_start = timeGetTime(); _start = timeGetTime();
...@@ -25,7 +25,7 @@ void RunTime::start() ...@@ -25,7 +25,7 @@ void RunTime::start()
void RunTime::stop() void RunTime::stop()
{ {
#ifndef _WIN32 #ifndef _MSC_VER
gettimeofday(&_stop, 0); gettimeofday(&_stop, 0);
#else #else
_stop = timeGetTime(); _stop = timeGetTime();
...@@ -34,7 +34,7 @@ void RunTime::stop() ...@@ -34,7 +34,7 @@ void RunTime::stop()
double RunTime::elapsed() 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)); return (_stop.tv_sec + _stop.tv_usec/1000000.0 - (_start.tv_sec + _start.tv_usec/1000000.0));
#else #else
return (_stop - _start) / 1000.0; return (_stop - _start) / 1000.0;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "TimeMeasurementBase.h" #include "TimeMeasurementBase.h"
#ifndef _WIN32 #ifndef _MSC_VER
#include <sys/time.h> #include <sys/time.h>
#else #else
#include <windows.h> #include <windows.h>
...@@ -33,7 +33,7 @@ public: ...@@ -33,7 +33,7 @@ public:
virtual double elapsed(); virtual double elapsed();
~RunTime() {}; ~RunTime() {};
private: private:
#ifndef _WIN32 #ifndef _MSC_VER
timeval _start; timeval _start;
timeval _stop; timeval _stop;
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment