X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=f4b872c791d61a8bf9c282dff55627b02a025d84;hb=0a18ce8f4cd1a723f50333945d94c84b45c8d56b;hp=1b119d65bdbb96a6d859096a80792289f52c8cb7;hpb=36ea307baa89088cae666d3c9134e386c08c9d57;p=novacoin.git diff --git a/src/util.h b/src/util.h index 1b119d6..f4b872c 100644 --- a/src/util.h +++ b/src/util.h @@ -35,6 +35,8 @@ #include "netbase.h" // for AddTimeData +static const int32_t nOneHour = 60 * 60; +static const int32_t nOneDay = 24 * 60 * 60; static const int64_t COIN = 1000000; static const int64_t CENT = 10000; @@ -59,6 +61,18 @@ static const int64_t CENT = 10000; void LogStackTrace(); #endif +#if defined(_MSC_VER) || defined(__MSVCRT__) + /* Silence compiler warnings on Windows + related to MinGWs inttypes.h */ + #undef PRIu64 + #undef PRId64 + #undef PRIx64 + + #define PRIu64 "I64u" + #define PRId64 "I64d" + #define PRIx64 "I64x" + +#endif /* Format characters for (s)size_t and ptrdiff_t */ #if defined(_MSC_VER) || defined(__MSVCRT__) @@ -368,7 +382,7 @@ inline int64_t GetPerformanceCounter() inline int64_t GetTimeMillis() { - return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - + return (boost::posix_time::microsec_clock::universal_time() - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); }