From 736789a9ede5baa2583551ca14214c4113c602b7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 30 Aug 2018 16:29:19 +0300 Subject: [PATCH] Closed beta version 1.3.14.1: Fix for OS X old. --- Telegram/SourceFiles/base/base_pch.h | 4 ++++ Telegram/SourceFiles/base/basic_types.h | 18 ++++++++++++++++++ Telegram/SourceFiles/core/utils.h | 18 ------------------ .../storage/cache/storage_cache_types.h | 2 ++ Telegram/SourceFiles/storage/storage_pch.h | 4 ++++ 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/base/base_pch.h b/Telegram/SourceFiles/base/base_pch.h index 91cfe95ee..6fd488959 100644 --- a/Telegram/SourceFiles/base/base_pch.h +++ b/Telegram/SourceFiles/base/base_pch.h @@ -14,6 +14,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +#define OS_MAC_OLD +#endif // QT_VERSION < 5.5.0 + #include #include diff --git a/Telegram/SourceFiles/base/basic_types.h b/Telegram/SourceFiles/base/basic_types.h index 6a12ede99..08c6218fb 100644 --- a/Telegram/SourceFiles/base/basic_types.h +++ b/Telegram/SourceFiles/base/basic_types.h @@ -47,3 +47,21 @@ using float64 = double; using TimeMs = int64; using TimeId = int32; + +// Define specializations for QByteArray for Qt 5.3.2, because +// QByteArray in Qt 5.3.2 doesn't declare "pointer" subtype. +#ifdef OS_MAC_OLD +namespace gsl { + +template <> +inline span make_span(QByteArray &cont) { + return span(cont.data(), cont.size()); +} + +template <> +inline span make_span(const QByteArray &cont) { + return span(cont.constData(), cont.size()); +} + +} // namespace gsl +#endif // OS_MAC_OLD diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 5fd9c42bc..0cd40599e 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -23,24 +23,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #define qsl(s) QStringLiteral(s) -// Define specializations for QByteArray for Qt 5.3.2, because -// QByteArray in Qt 5.3.2 doesn't declare "pointer" subtype. -#ifdef OS_MAC_OLD -namespace gsl { - -template <> -inline span make_span(QByteArray &cont) { - return span(cont.data(), cont.size()); -} - -template <> -inline span make_span(const QByteArray &cont) { - return span(cont.constData(), cont.size()); -} - -} // namespace gsl -#endif // OS_MAC_OLD - namespace base { template diff --git a/Telegram/SourceFiles/storage/cache/storage_cache_types.h b/Telegram/SourceFiles/storage/cache/storage_cache_types.h index 8dc942878..da76a07f5 100644 --- a/Telegram/SourceFiles/storage/cache/storage_cache_types.h +++ b/Telegram/SourceFiles/storage/cache/storage_cache_types.h @@ -11,6 +11,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/flat_map.h" #include "base/optional.h" #include +#include +#include namespace Storage { namespace Cache { diff --git a/Telegram/SourceFiles/storage/storage_pch.h b/Telegram/SourceFiles/storage/storage_pch.h index 64d635c3d..11e41c6cf 100644 --- a/Telegram/SourceFiles/storage/storage_pch.h +++ b/Telegram/SourceFiles/storage/storage_pch.h @@ -12,6 +12,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +#define OS_MAC_OLD +#endif // QT_VERSION < 5.5.0 + #include #include