X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Futil.h;fp=src%2Futil.h;h=dc40af5e02e52860946b70d1078946028633efaf;hp=ef152607732bf462fde9763bca0a54eb4eab94ab;hb=0561bbd1c69263dceb24ffacf850788e6e961a13;hpb=6e0c5e3778b83f128f6f14c311d5728392053581 diff --git a/src/util.h b/src/util.h index ef15260..dc40af5 100644 --- a/src/util.h +++ b/src/util.h @@ -1,5 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers +// Copyright (c) 2012 The PPCoin 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 @@ -36,8 +37,8 @@ typedef int pid_t; /* define for windows compatiblity */ typedef long long int64; typedef unsigned long long uint64; -static const int64 COIN = 100000000; -static const int64 CENT = 1000000; +static const int64 COIN = 1000000; +static const int64 CENT = 10000; #define loop for (;;) #define BEGIN(a) ((char*)&(a)) @@ -103,8 +104,14 @@ inline void Sleep(int64 n) } #endif - - +#ifndef THROW_WITH_STACKTRACE +#define THROW_WITH_STACKTRACE(exception) \ +{ \ + LogStackTrace(); \ + throw (exception); \ +} +void LogStackTrace(); +#endif @@ -661,9 +668,9 @@ public: // Note: It turns out we might have been able to use boost::thread // by using TerminateThread(boost::thread.native_handle(), 0); #ifdef WIN32 -typedef HANDLE pthread_t; +typedef HANDLE bitcoin_pthread_t; -inline pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=false) +inline bitcoin_pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=false) { DWORD nUnused = 0; HANDLE hthread = @@ -677,12 +684,12 @@ inline pthread_t CreateThread(void(*pfn)(void*), void* parg, bool fWantHandle=fa if (hthread == NULL) { printf("Error: CreateThread() returned %d\n", GetLastError()); - return (pthread_t)0; + return (bitcoin_pthread_t)0; } if (!fWantHandle) { CloseHandle(hthread); - return (pthread_t)-1; + return (bitcoin_pthread_t)-1; } return hthread; }