mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:43:02 +01:00
Backport better workaround for problem with static_assert(false) in gcc/clang compilers
This commit is contained in:
parent
71f51d90a1
commit
549f444e52
@ -267,6 +267,10 @@ namespace fb_utils
|
|||||||
bool isBpbSegmented(unsigned parLength, const unsigned char* par);
|
bool isBpbSegmented(unsigned parLength, const unsigned char* par);
|
||||||
|
|
||||||
|
|
||||||
|
// Workaround, to be removed with C++ 23
|
||||||
|
template <typename... T>
|
||||||
|
constexpr bool fb_always_false_v = false;
|
||||||
|
|
||||||
// Put integer value into info buffer
|
// Put integer value into info buffer
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline unsigned char* putInfoItemInt(const unsigned char item, T value,
|
inline unsigned char* putInfoItemInt(const unsigned char item, T value,
|
||||||
@ -300,7 +304,7 @@ namespace fb_utils
|
|||||||
else if constexpr (len == sizeof(char))
|
else if constexpr (len == sizeof(char))
|
||||||
*ptr = value;
|
*ptr = value;
|
||||||
else
|
else
|
||||||
static_assert(len == 0, "unknown data type");
|
static_assert(fb_always_false_v<T>, "unknown data type");
|
||||||
|
|
||||||
ptr += len;
|
ptr += len;
|
||||||
return ptr;
|
return ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user