X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=6ddc7a6f1e7a237bd380bc0933cfb5b500b18d06;hb=56d7e2c8baefaa0229b42cef66c97da22c42dd61;hp=c233a0b720c59e91800bc32884f9742ab8d62347;hpb=77a43545b4491b9703d803765da9059d2bdd5aaa;p=novacoin.git diff --git a/src/util.h b/src/util.h index c233a0b..6ddc7a6 100644 --- a/src/util.h +++ b/src/util.h @@ -5,7 +5,7 @@ #ifndef BITCOIN_UTIL_H #define BITCOIN_UTIL_H -#include + #include "uint256.h" #ifndef WIN32 @@ -28,6 +28,11 @@ #include +#if defined(__USE_MINGW_ANSI_STDIO) +#undef __USE_MINGW_ANSI_STDIO // This constant forces MinGW to conduct stupid behavior +#endif +#include + #include "netbase.h" // for AddTimeData @@ -346,14 +351,7 @@ inline int64_t GetTimeMillis() boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); } -inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) -{ - time_t n = nTime; - struct tm* ptmTime = gmtime(&n); - char pszTime[200]; - strftime(pszTime, sizeof(pszTime), pszFormat, ptmTime); - return pszTime; -} +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); static const std::string strTimestampFormat = "%Y-%m-%d %H:%M:%S UTC"; inline std::string DateTimeStrFormat(int64_t nTime) @@ -485,7 +483,7 @@ public: int size() const { - return vValues.size(); + return static_cast(vValues.size()); } std::vector sorted () const