aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-10-09 20:26:40 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-10-09 20:26:40 +0200
commit8828da5f56313855e19f463ff1c09196812b997b (patch)
treee54e27b1a7d5287bbe245189c3044cc1a19ba02b /src/util.cpp
parentba2db7262bec34d45c75c6842c3a1c0cfaba893e (diff)
parent4db9705dd839cbb386398b1eb4be2a67357c27c4 (diff)
downloadbitcoin-8828da5f56313855e19f463ff1c09196812b997b.tar.xz
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util.cpp b/src/util.cpp
index fb648a9721..236c7f7c44 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -64,7 +64,7 @@ public:
ppmutexOpenSSL[i] = new boost::interprocess::interprocess_mutex();
CRYPTO_set_locking_callback(locking_callback);
-#ifdef __WXMSW__
+#ifdef WIN32
// Seed random number generator with screen scrape and other hardware sources
RAND_screen();
#endif
@@ -108,7 +108,7 @@ void RandAddSeedPerfmon()
return;
nLastPerfmon = GetTime();
-#ifdef __WXMSW__
+#ifdef WIN32
// Don't need this on Linux, OpenSSL automatically uses /dev/urandom
// Seed with the entire set of perfmon data
unsigned char pdata[250000];
@@ -198,7 +198,7 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
}
}
-#ifdef __WXMSW__
+#ifdef WIN32
if (fPrintToDebugger)
{
static CCriticalSection cs_OutputDebugStringF;
@@ -387,7 +387,7 @@ bool ParseMoney(const char* pszIn, int64& nRet)
for (; *p; p++)
if (!isspace(*p))
return false;
- if (strWhole.size() > 14)
+ if (strWhole.size() > 10) // guard against 63 bit overflow
return false;
if (nUnits < 0 || nUnits > COIN)
return false;
@@ -457,7 +457,7 @@ void ParseParameters(int argc, char* argv[])
pszValue = strchr(psz, '=');
*pszValue++ = '\0';
}
- #ifdef __WXMSW__
+ #ifdef WIN32
_strlwr(psz);
if (psz[0] == '/')
psz[0] = '-';
@@ -648,7 +648,7 @@ bool WildcardMatch(const string& str, const string& mask)
void FormatException(char* pszMessage, std::exception* pex, const char* pszThread)
{
-#ifdef __WXMSW__
+#ifdef WIN32
char pszModule[MAX_PATH];
pszModule[0] = '\0';
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
@@ -707,7 +707,7 @@ void PrintExceptionContinue(std::exception* pex, const char* pszThread)
-#ifdef __WXMSW__
+#ifdef WIN32
typedef WINSHELLAPI BOOL (WINAPI *PSHGETSPECIALFOLDERPATHA)(HWND hwndOwner, LPSTR lpszPath, int nFolder, BOOL fCreate);
string MyGetSpecialFolderPath(int nFolder, bool fCreate)
@@ -748,7 +748,7 @@ string GetDefaultDataDir()
// Windows: C:\Documents and Settings\username\Application Data\Bitcoin
// Mac: ~/Library/Application Support/Bitcoin
// Unix: ~/.bitcoin
-#ifdef __WXMSW__
+#ifdef WIN32
// Windows
return MyGetSpecialFolderPath(CSIDL_APPDATA, true) + "\\Bitcoin";
#else
@@ -758,7 +758,7 @@ string GetDefaultDataDir()
string strHome = pszHome;
if (strHome[strHome.size()-1] != '/')
strHome += '/';
-#ifdef __WXMAC_OSX__
+#ifdef MAC_OSX
// Mac
strHome += "Library/Application Support/";
filesystem::create_directory(strHome.c_str());