mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:03:03 +01:00
Workaround problem with static_assert(false) in gcc/clang compilers
This commit is contained in:
parent
216fb3e164
commit
ba62d07a1e
@ -275,6 +275,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,
|
||||||
@ -308,7 +312,7 @@ namespace fb_utils
|
|||||||
else if constexpr (len == sizeof(char))
|
else if constexpr (len == sizeof(char))
|
||||||
*ptr = value;
|
*ptr = value;
|
||||||
else
|
else
|
||||||
static_assert(always_false<T>::value, "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