Changeset View
Changeset View
Standalone View
Standalone View
src/compat/assumptions.h
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | static_assert((int64_t(-1) >> 1) == int64_t(-1), | ||||
"Arithmetic right shift assumed"); | "Arithmetic right shift assumed"); | ||||
/** | /** | ||||
* /!\ C++ Does not guarantee 2-complement, but it implementation defined. All | * /!\ C++ Does not guarantee 2-complement, but it implementation defined. All | ||||
* the platform we support use 2-complement. | * the platform we support use 2-complement. | ||||
*/ | */ | ||||
static_assert((int64_t(-10) & 0xffff) == 0xfff6, "2-complement assumed"); | static_assert((int64_t(-10) & 0xffff) == 0xfff6, "2-complement assumed"); | ||||
/** | |||||
* Assume int64_t and long long int are the same type. | |||||
*/ | |||||
static_assert(std::numeric_limits<long long int>::max() == | |||||
std::numeric_limits<int64_t>::max()); | |||||
static_assert(std::numeric_limits<long long int>::min() == | |||||
std::numeric_limits<int64_t>::min()); | |||||
#endif // BITCOIN_COMPAT_ASSUMPTIONS_H | #endif // BITCOIN_COMPAT_ASSUMPTIONS_H |