Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to_variant(size_t) for macOS and OpenBSD #194

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions include/fc/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,7 @@ namespace fc
memset( this, 0, sizeof(*this) );
to_variant( val, *this, max_depth );
}
#ifdef __APPLE__
inline void to_variant( size_t s, variant& v, uint32_t max_depth ) { v = variant(uint64_t(s)); }
#endif

template<typename T>
void to_variant( const std::shared_ptr<T>& var, variant& vo, uint32_t max_depth )
{
Expand Down
5 changes: 2 additions & 3 deletions src/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,8 @@ void from_variant( const variant& var, uint128_t& vo, uint32_t max_depth )
#endif
}

#if defined(__APPLE__)
#elif defined(__OpenBSD__)
void to_variant( size_t s, variant& v, uint32_t max_depth ) { v = variant( int64_t(s) ); }
#if defined(__APPLE__) or defined(__OpenBSD__)
void to_variant( size_t s, variant& v, uint32_t max_depth ) { v = variant( uint64_t(s) ); }
#elif !defined(_WIN32)
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)); }
Expand Down