Changeset View
Changeset View
Standalone View
Standalone View
src/compat/assumptions.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
// Some important things we are NOT assuming (non-exhaustive list): | // Some important things we are NOT assuming (non-exhaustive list): | ||||
// * We are NOT assuming a specific value for sizeof(std::size_t). | // * We are NOT assuming a specific value for sizeof(std::size_t). | ||||
// * We are NOT assuming a specific value for std::endian::native. | // * We are NOT assuming a specific value for std::endian::native. | ||||
// * We are NOT assuming a specific value for std::locale("").name(). | // * We are NOT assuming a specific value for std::locale("").name(). | ||||
// * We are NOT assuming a specific value for | // * We are NOT assuming a specific value for | ||||
// std::numeric_limits<char>::is_signed. | // std::numeric_limits<char>::is_signed. | ||||
/** | |||||
* /!\ C++ right shift signedness handling is implementation defined. It is | |||||
* defined as an arithmetic on all the platform we support, but this | |||||
* may not be the case on other platforms. | |||||
* | |||||
* NB: C++20 defines signed right shift as being arithmetic shifts, so in | |||||
* practice, we should see all platforms converge toward that behavior if | |||||
* they haven't already. | |||||
*/ | |||||
static_assert( | |||||
(int64_t(-1) >> 1) == int64_t(-1), | |||||
"deterministicExp2 require a compiler using arithmetic right shift."); | |||||
#endif // BITCOIN_COMPAT_ASSUMPTIONS_H | #endif // BITCOIN_COMPAT_ASSUMPTIONS_H |