changes to make this compile on Windows

This commit is contained in:
Vadim Kurland
2010-11-16 15:57:34 -08:00
parent 2e3d1f2f43
commit edbdee81ca
2 changed files with 17 additions and 17 deletions
+4 -4
View File
@@ -168,16 +168,16 @@ uint128 InetAddr::to_uint128() const
{
assert(isV6());
uint128 res;
uint128 x = ntohl(((uint32_t *) (&ipv6))[0]);
uint128 x = uint64_t(ntohl(((uint32_t *) (&ipv6))[0]));
x <<= 96;
res |= x;
x = ntohl(((uint32_t *) (&ipv6))[1]);
x = uint64_t(ntohl(((uint32_t *) (&ipv6))[1]));
x <<= 64;
res |= x;
x = ntohl(((uint32_t *) (&ipv6))[2]);
x = uint64_t(ntohl(((uint32_t *) (&ipv6))[2]));
x <<= 32;
res |= x;
x = ntohl(((uint32_t *) (&ipv6))[3]);
x = uint64_t(ntohl(((uint32_t *) (&ipv6))[3]));
res |= x;
return res;
}
+13 -13
View File
@@ -34,7 +34,7 @@
#include <limits>
#include <limits.h>
#include <stdio.h>
// #include <stdio.h>
// convinience macro
#define U128_C(s) uint128(#s)
@@ -521,18 +521,18 @@ template<>
struct numeric_limits<uint128>
{
static const bool is_specialized = true;
static uint128 min() throw()
{
return 0;
}
static uint128 max() throw()
{
return uint128(
std::numeric_limits<uint64_t>::max(),
std::numeric_limits<uint64_t>::max()
);
}
// static uint128 min() throw()
// {
// return 0;
// }
//
// static uint128 max() throw()
// {
// return uint128(
// std::numeric_limits<uint64_t>::max(),
// std::numeric_limits<uint64_t>::max()
// );
// }
static const bool is_signed = false;
static const bool is_integer = true;