diff --git a/include/orm/utils/integralcast.hpp b/include/orm/utils/integralcast.hpp index 133898acd..a563aa455 100644 --- a/include/orm/utils/integralcast.hpp +++ b/include/orm/utils/integralcast.hpp @@ -37,6 +37,36 @@ namespace Private else if constexpr (std::is_same_v) return "bool"; + // Platform dependent long int type (LP64, LLP64, ILP32, and LP32) + else if constexpr (std::is_same_v) { + + if constexpr (sizeof (T) == 4) + return "int32 (long)"; + else if constexpr (sizeof (T) == 8) + return "int64 (long)"; + else if constexpr (sizeof (T) == 2) + return "int16 (long)"; + else + // This should never happen :/ + static_assert (false, + "Unhandled code branch in the Private::IntegralTypeName() " + "(long)."); + } + else if constexpr (std::is_same_v) { + + if constexpr (sizeof (T) == 4) + return "uint32 (ulong)"; + else if constexpr (sizeof (T) == 8) + return "uint64 (ulong)"; + else if constexpr (sizeof (T) == 2) + return "uint16 (ulong)"; + else + // This should never happen :/ + static_assert (false, + "Unhandled code branch in the Private::IntegralTypeName() " + "(ulong)."); + } + else if constexpr (std::is_same_v) return "int16"; else if constexpr (std::is_same_v)