X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.h;h=6ddc7a6f1e7a237bd380bc0933cfb5b500b18d06;hb=56d7e2c8baefaa0229b42cef66c97da22c42dd61;hp=cd2f3d91adec4b8ec74270ad91f9747f98950f67;hpb=5e5977ef1bd124ed48c341cdc3f8eef528984c7b;p=novacoin.git diff --git a/src/util.h b/src/util.h index cd2f3d9..6ddc7a6 100644 --- a/src/util.h +++ b/src/util.h @@ -1,15 +1,10 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTIL_H #define BITCOIN_UTIL_H -#if !defined(_MSC_VER) || _MSC_VER > 1700 -#include -#else -#include "inttypes.h" -#endif #include "uint256.h" @@ -33,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 @@ -351,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) @@ -490,7 +483,7 @@ public: int size() const { - return vValues.size(); + return static_cast(vValues.size()); } std::vector sorted () const