FC Updates from BitShares and myself #21
5 changed files with 18 additions and 13 deletions
|
|
@ -141,11 +141,11 @@ ENDIF(WIN32)
|
||||||
FIND_PACKAGE(Boost CONFIG COMPONENTS ${BOOST_COMPONENTS})
|
FIND_PACKAGE(Boost CONFIG COMPONENTS ${BOOST_COMPONENTS})
|
||||||
|
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
MESSAGE(STATUS "Configuring fc to build on Unix/Apple")
|
MESSAGE(STATUS "Configuring fc to build on Unix/Apple")
|
||||||
|
|
||||||
if(NOT APPLE)
|
IF(NOT APPLE AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
|
||||||
SET(rt_library rt)
|
SET(rt_library rt )
|
||||||
endif(NOT APPLE)
|
ENDIF(NOT APPLE AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
|
||||||
ENDIF(NOT WIN32)
|
ENDIF(NOT WIN32)
|
||||||
|
|
||||||
IF($ENV{OPENSSL_ROOT_DIR})
|
IF($ENV{OPENSSL_ROOT_DIR})
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace fc
|
||||||
std::string to_pretty_string( int64_t );
|
std::string to_pretty_string( int64_t );
|
||||||
inline std::string to_string( int32_t v ) { return to_string( int64_t(v) ); }
|
inline std::string to_string( int32_t v ) { return to_string( int64_t(v) ); }
|
||||||
inline std::string to_string( uint32_t v ){ return to_string( uint64_t(v) ); }
|
inline std::string to_string( uint32_t v ){ return to_string( uint64_t(v) ); }
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
inline std::string to_string( size_t s) { return to_string(uint64_t(s)); }
|
inline std::string to_string( size_t s) { return to_string(uint64_t(s)); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ namespace fc
|
||||||
void to_variant( const uint128_t& var, variant& vo, uint32_t max_depth = 1 );
|
void to_variant( const uint128_t& var, variant& vo, uint32_t max_depth = 1 );
|
||||||
void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth = 1 );
|
void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth = 1 );
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
void to_variant( size_t s, variant& v, uint32_t max_depth = 1 );
|
void to_variant( size_t s, variant& v, uint32_t max_depth = 1 );
|
||||||
#elif !defined(_WIN32)
|
#elif !defined(_WIN32)
|
||||||
void to_variant( long long int s, variant& v, uint32_t max_depth = 1 );
|
void to_variant( long long int s, variant& v, uint32_t max_depth = 1 );
|
||||||
|
|
@ -229,7 +229,7 @@ namespace fc
|
||||||
variant( uint32_t val, uint32_t max_depth = 1 );
|
variant( uint32_t val, uint32_t max_depth = 1 );
|
||||||
variant( int32_t val, uint32_t max_depth = 1 );
|
variant( int32_t val, uint32_t max_depth = 1 );
|
||||||
variant( uint64_t val, uint32_t max_depth = 1 );
|
variant( uint64_t val, uint32_t max_depth = 1 );
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
variant( size_t val, uint32_t max_depth = 1 );
|
variant( size_t val, uint32_t max_depth = 1 );
|
||||||
#endif
|
#endif
|
||||||
variant( int64_t val, uint32_t max_depth = 1 );
|
variant( int64_t val, uint32_t max_depth = 1 );
|
||||||
|
|
@ -632,7 +632,7 @@ namespace fc
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void to_variant( const safe<T>& s, variant& v, uint32_t max_depth ) {
|
void to_variant( const safe<T>& s, variant& v, uint32_t max_depth ) {
|
||||||
to_variant( s.value, v, max_depth );
|
to_variant( static_cast<T>(s.value), v, max_depth );
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
#if BOOST_VERSION / 100 >= 1065 && !defined(__APPLE__)
|
#if BOOST_VERSION / 100 >= 1065 && !defined(__APPLE__)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <fc/log/logger.hpp>
|
#include <fc/log/logger.hpp>
|
||||||
|
#if defined(__OpenBSD__)
|
||||||
|
#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
|
||||||
|
#endif
|
||||||
#include <boost/stacktrace.hpp>
|
#include <boost/stacktrace.hpp>
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include <fc/reflect/variant.hpp>
|
#include <fc/reflect/variant.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
#include <boost/multiprecision/integer.hpp>
|
#include <boost/multiprecision/integer.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ variant::variant( uint64_t val, uint32_t max_depth )
|
||||||
set_variant_type( this, uint64_type );
|
set_variant_type( this, uint64_type );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
variant::variant( size_t val, uint32_t max_depth )
|
variant::variant( size_t val, uint32_t max_depth )
|
||||||
{
|
{
|
||||||
*reinterpret_cast<uint64_t*>(this) = val;
|
*reinterpret_cast<uint64_t*>(this) = val;
|
||||||
|
|
@ -679,7 +679,7 @@ void from_variant( const variant& var, std::vector<char>& vo, uint32_t max_depth
|
||||||
|
|
||||||
void to_variant( const uint128_t& var, variant& vo, uint32_t max_depth )
|
void to_variant( const uint128_t& var, variant& vo, uint32_t max_depth )
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
boost::multiprecision::uint128_t helper = uint128_hi64( var );
|
boost::multiprecision::uint128_t helper = uint128_hi64( var );
|
||||||
helper <<= 64;
|
helper <<= 64;
|
||||||
helper += uint128_lo64( var );
|
helper += uint128_lo64( var );
|
||||||
|
|
@ -691,7 +691,7 @@ void to_variant( const uint128_t& var, variant& vo, uint32_t max_depth )
|
||||||
|
|
||||||
void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth )
|
void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth )
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) or defined(__OpenBSD__)
|
||||||
boost::multiprecision::uint128_t helper = boost::lexical_cast<boost::multiprecision::uint128_t>( var.as_string() );
|
boost::multiprecision::uint128_t helper = boost::lexical_cast<boost::multiprecision::uint128_t>( var.as_string() );
|
||||||
vo = static_cast<uint64_t>( helper >> 64 );
|
vo = static_cast<uint64_t>( helper >> 64 );
|
||||||
vo <<= 64;
|
vo <<= 64;
|
||||||
|
|
@ -701,7 +701,9 @@ void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__)
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
void to_variant( size_t s, variant& v, uint32_t max_depth ) { v = variant( int64_t(s) ); }
|
||||||
#elif !defined(_WIN32)
|
#elif !defined(_WIN32)
|
||||||
void to_variant( long long int s, variant& v, uint32_t max_depth ) { v = variant( int64_t(s) ); }
|
void to_variant( long long int s, variant& v, uint32_t max_depth ) { v = variant( int64_t(s) ); }
|
||||||
void to_variant( unsigned long long int s, variant& v, uint32_t max_depth ) { v = variant( uint64_t(s)); }
|
void to_variant( unsigned long long int s, variant& v, uint32_t max_depth ) { v = variant( uint64_t(s)); }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue