Fix build on windows and mac
Replaced all occurrences of #if* __WXMSW__ with WIN32, and all occurrences of __WXMAC_OSX__ with MAC_OSX, and made sure those are defined appropriately in the makefile and bitcoin-qt.pro.
This commit is contained in:
16
src/util.cpp
16
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;
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user