mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-14 00:49:09 +02:00
changes to make this compile on Windows
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user