diff --git a/src/CNStructs.cpp b/src/CNStructs.cpp index d949cc8..2885f36 100644 --- a/src/CNStructs.cpp +++ b/src/CNStructs.cpp @@ -18,7 +18,13 @@ int U8toU16(std::string src, char16_t* des) { } uint64_t getTime() { +#ifndef _MSC_VER struct timeval tp; gettimeofday(&tp, NULL); return tp.tv_sec * 1000 + tp.tv_usec / 1000; +#else + time_t t; + time(&t); + return (uint64_t)t; +#endif } \ No newline at end of file diff --git a/src/CNStructs.hpp b/src/CNStructs.hpp index ef950f6..539ee7e 100644 --- a/src/CNStructs.hpp +++ b/src/CNStructs.hpp @@ -10,7 +10,12 @@ #include #include #include +// Can't use this in MSVC. +#ifndef _MSC_VER #include +#else +#include +#endif #include #include #include