compile on windows

This commit is contained in:
jed
2012-06-05 14:06:21 -07:00
parent 79cc39f902
commit 6559655218
7 changed files with 52 additions and 13 deletions

View File

@@ -103,7 +103,6 @@
<ClCompile Include="src\Config.cpp" />
<ClCompile Include="src\ConnectionPool.cpp" />
<ClCompile Include="src\Conversion.cpp" />
<ClCompile Include="src\Currency.cpp" />
<ClCompile Include="src\DBInit.cpp" />
<ClCompile Include="src\DeterministicKeys.cpp" />
<ClCompile Include="src\ECIES.cpp" />
@@ -112,12 +111,14 @@
<ClCompile Include="src\HttpsClient.cpp" />
<ClCompile Include="src\Ledger.cpp" />
<ClCompile Include="src\LedgerAcquire.cpp" />
<ClCompile Include="src\LedgerConsensus.cpp" />
<ClCompile Include="src\LedgerFormats.cpp" />
<ClCompile Include="src\LedgerHistory.cpp" />
<ClCompile Include="src\LedgerIndex.cpp" />
<ClCompile Include="src\LedgerMaster.cpp" />
<ClCompile Include="src\LedgerNode.cpp" />
<ClCompile Include="src\LocalTransaction.cpp" />
<ClCompile Include="src\LedgerProposal.cpp" />
<ClCompile Include="src\Log.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\NetworkOPs.cpp" />
<ClCompile Include="src\NewcoinAddress.cpp" />
@@ -129,6 +130,7 @@
<ClCompile Include="src\PubKeyCache.cpp" />
<ClCompile Include="src\RequestParser.cpp" />
<ClCompile Include="src\rfc1751.cpp" />
<ClCompile Include="src\RippleState.cpp" />
<ClCompile Include="src\rpc.cpp" />
<ClCompile Include="src\RPCCommands.cpp" />
<ClCompile Include="src\RPCDoor.cpp" />

View File

@@ -81,9 +81,6 @@
<ClCompile Include="src\Conversion.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Currency.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\DBInit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -123,9 +120,6 @@
<ClCompile Include="src\LedgerNode.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\LocalTransaction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -237,6 +231,18 @@
<ClCompile Include="obj\src\newcoin.pb.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\RippleState.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Log.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\LedgerConsensus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\LedgerProposal.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Application.h">

View File

@@ -100,7 +100,7 @@ bool STAmount::setValue(const std::string& sAmount, const std::string& sCurrency
if (bInteger)
{
uValue = sAmount.empty() ? 0 : boost::lexical_cast<uint>(sAmount);
uValue = sAmount.empty() ? 0 : boost::lexical_cast<unsigned int>(sAmount);
iOffset = 0;
}
else

View File

@@ -1,4 +1,3 @@
#include <openssl/ec.h>
#include <openssl/bn.h>
#include <openssl/ecdsa.h>

View File

@@ -248,7 +248,7 @@ Json::Value RPCServer::authorize(const uint256& uLedger,
// Find the index of the account from the master generator, so we can generate the public and private keys.
NewcoinAddress naMasterAccountPublic;
uint iIndex = -1; // Compensate for initial increment.
unsigned int iIndex = -1; // Compensate for initial increment.
// XXX Stop after Config.account_probe_max
// Don't look at ledger entries to determine if the account exists. Don't want to leak to thin server that these accounts are
@@ -945,7 +945,7 @@ Json::Value RPCServer::doPasswordSet(Json::Value& params)
NewcoinAddress naMasterXPublic;
NewcoinAddress naRegularXPublic;
uint iIndex = -1; // Compensate for initial increment.
unsigned int iIndex = -1; // Compensate for initial increment.
int iMax = theConfig.ACCOUNT_PROBE_MAX;
// YYY Could probe peridoically to see if accounts exists.
@@ -1295,7 +1295,7 @@ Json::Value RPCServer::accounts(const uint256& uLedger, const NewcoinAddress& na
// YYY Don't want to leak to thin server that these accounts are related.
// YYY Would be best to alternate requests to servers and to cache results.
uint uIndex = 0;
unsigned int uIndex = 0;
do {
NewcoinAddress naAccount;

View File

@@ -102,4 +102,32 @@ DH* DH_der_load_hex(const std::string& strDer)
return DH_der_load(strBuf);
}
#ifdef WIN32
#define _WINSOCK_
#include <winsock2.h>
//#include "Winsock2.h"
//#include <windows.h>
// from: http://stackoverflow.com/questions/3022552/is-there-any-standard-htonl-like-function-for-64-bits-integers-in-c
// but we don't need to check the endianness
uint64_t htobe64(uint64_t value)
{
// The answer is 42
//static const int num = 42;
// Check the endianness
//if (*reinterpret_cast<const char*>(&num) == num)
//{
const uint32_t high_part = htonl(static_cast<uint32_t>(value >> 32));
const uint32_t low_part = htonl(static_cast<uint32_t>(value & 0xFFFFFFFFLL));
return (static_cast<uint64_t>(low_part) << 32) | high_part;
//} else
//{
// return value;
//}
}
#endif
// vim:ts=4

View File

@@ -19,6 +19,10 @@
#define MIN(x,y) ((x) > (y) ? (y) : (x))
#endif
#ifdef WIN32
extern uint64_t htobe64(uint64_t value);
#endif
boost::posix_time::ptime ptEpoch();
int iToSeconds(boost::posix_time::ptime ptWhen);
boost::posix_time::ptime ptFromSeconds(int iSeconds);