WSL/SLF GitLab Repository

Commit 106004ae authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Small tweaks so that code::blocks on Windows also compiles MeteoIO...

Small tweaks so that code::blocks on Windows also compiles MeteoIO correctly... (like a never ending story)
parent 174a0b12
......@@ -20,7 +20,7 @@
using namespace std;
#ifdef _WIN32
#ifdef MSVC
//This is C99, Microsoft should move on and suppport it, it is almost 15 years old!!
double round(const double& x) {
//middle value point test
......
......@@ -26,7 +26,6 @@
//removing two macros defined in windows.h
#undef max
#undef min
#include <strsafe.h>
#else
#include <dirent.h>
#include <sys/stat.h>
......
......@@ -95,9 +95,9 @@ double Timer::getCurrentTime() {
uli.LowPart = fileTime.dwLowDateTime;
uli.HighPart = fileTime.dwHighDateTime;
ULONGLONG units_convert = 10000*1000; //it gives the time since 1 January 1601 (UTC) in units of 100ns
return (double)(uli.QuadPart/units_convert - 11644473600L); //offset in seconds to Unix epoch
//this is 134774 days * 24*3600
const ULONGLONG units_convert = 10000*1000; //it gives the time since 1 January 1601 (UTC) in units of 100ns
const ULONGLONG offset_to_epoch = 11644473600; //offset in seconds to Unix epoch, 134774 days * 24*3600
return (double)(uli.QuadPart/units_convert - offset_to_epoch);
}
#else
double Timer::getCurrentTime() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment