From 19415361f42985af21c1b221c71630095e9cf4dd Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 8 Dec 2022 10:00:51 +0400 Subject: [PATCH] Use std::conditional_t for Glib::Variant<(u)int64> rather than LONG_TYPE_SIZE --- base/platform/linux/base_linux_glibmm_helper.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/base/platform/linux/base_linux_glibmm_helper.h b/base/platform/linux/base_linux_glibmm_helper.h index 61997f9..864fe53 100644 --- a/base/platform/linux/base_linux_glibmm_helper.h +++ b/base/platform/linux/base_linux_glibmm_helper.h @@ -10,11 +10,16 @@ #include -#if LONG_TYPE_SIZE == 64 namespace Glib { +struct Int64Helper0 {}; +using Int64Helper = std::conditional_t, Int64Helper0, int64>; + +struct UInt64Helper0 {}; +using UInt64Helper = std::conditional_t, UInt64Helper0, uint64>; + template <> -class Variant : public VariantBase { +class Variant : public VariantBase { public: using CType = gint64; @@ -58,7 +63,7 @@ class Variant : public VariantBase { }; template <> -class Variant : public VariantBase { +class Variant : public VariantBase { public: using CType = guint64; @@ -102,7 +107,6 @@ class Variant : public VariantBase { }; } // namespace Glib -#endif // LONG_TYPE_SIZE == 64 namespace base { namespace Platform {