mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
compile on windows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user