diff --git a/README.md b/README.md index 683bea0a9..47fa9a247 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is ## Build instructions * [Visual Studio 2017][msvc] -* [Xcode 8][xcode] +* [Xcode 9][xcode] * [GYP/CMake on GNU/Linux][cmake] [//]: # (LINKS) diff --git a/Telegram/SourceFiles/core/basic_types.h b/Telegram/SourceFiles/core/basic_types.h index a6b142a99..b9a07b580 100644 --- a/Telegram/SourceFiles/core/basic_types.h +++ b/Telegram/SourceFiles/core/basic_types.h @@ -29,10 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org using gsl::not_null; -// Custom libc++ build used for old OS X versions already has this. -#ifndef OS_MAC_OLD - -#if defined COMPILER_CLANG || defined COMPILER_GCC +#if defined COMPILER_GCC namespace std { template @@ -44,9 +41,7 @@ template void as_const(const T&&) = delete; } // namespace std -#endif // COMPILER_CLANG || COMPILER_GCC - -#endif // OS_MAC_OLD +#endif // COMPILER_GCC #include "base/ordered_set.h" diff --git a/Telegram/SourceFiles/data/data_flags.h b/Telegram/SourceFiles/data/data_flags.h index 5c78a217b..34f12fcf7 100644 --- a/Telegram/SourceFiles/data/data_flags.h +++ b/Telegram/SourceFiles/data/data_flags.h @@ -24,9 +24,12 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org namespace Data { +template +using FlagsUnderlying = typename FlagsType::Type; + template < typename FlagsType, - typename FlagsType::Type kEssential = -1> + FlagsUnderlying kEssential = FlagsUnderlying(-1)> class Flags { public: using Type = FlagsType; diff --git a/Telegram/SourceFiles/mtproto/core_types.h b/Telegram/SourceFiles/mtproto/core_types.h index 19015c31d..f4997e69c 100644 --- a/Telegram/SourceFiles/mtproto/core_types.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -370,7 +370,7 @@ public: void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_flags) { if (from + 1 > end) throw mtpErrorInsufficient(); if (cons != mtpc_flags) throw mtpErrorUnexpected(cons, "MTPflags"); - v = Flags::from_raw(static_cast(*(from++))); + v = Flags::from_raw(static_cast(*(from++))); } void write(mtpBuffer &to) const { to.push_back(static_cast(v.value())); diff --git a/Telegram/SourceFiles/rpl/combine.h b/Telegram/SourceFiles/rpl/combine.h index e9d209e50..4a0284354 100644 --- a/Telegram/SourceFiles/rpl/combine.h +++ b/Telegram/SourceFiles/rpl/combine.h @@ -21,6 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #pragma once #include "base/optional.h" +#include #include #include #include diff --git a/Telegram/SourceFiles/rpl/combine_previous.h b/Telegram/SourceFiles/rpl/combine_previous.h index 6c4a6c826..000a14b54 100644 --- a/Telegram/SourceFiles/rpl/combine_previous.h +++ b/Telegram/SourceFiles/rpl/combine_previous.h @@ -42,7 +42,7 @@ public: return std::move(initial).start( [consumer, previous](auto &&value) { if (auto exists = *previous) { - &existing = *exists; + auto &existing = *exists; auto next = std::make_tuple( std::move(existing), value); diff --git a/Telegram/SourceFiles/rpl/details/callable.h b/Telegram/SourceFiles/rpl/details/callable.h index 146f1a479..6f6018adb 100644 --- a/Telegram/SourceFiles/rpl/details/callable.h +++ b/Telegram/SourceFiles/rpl/details/callable.h @@ -23,20 +23,12 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "base/build_config.h" #include - -// Custom libc++ build used for old OS X versions already has this. -#ifndef OS_MAC_OLD - -#if defined COMPILER_CLANG || defined COMPILER_GCC -namespace std { - #ifdef COMPILER_GCC +namespace std { template using bool_constant = integral_constant; -#endif // COMPILER_GCC - template constexpr auto tuple_size_v = std::tuple_size::value; @@ -70,9 +62,7 @@ constexpr decltype(auto) apply(Method &&method, Tuple&& tuple) { } } // namespace std -#endif // COMPILER_CLANG || COMPILER_GCC - -#endif // OS_MAC_OLD +#endif // COMPILER_GCC namespace rpl { namespace details { diff --git a/Telegram/SourceFiles/rpl/range.h b/Telegram/SourceFiles/rpl/range.h index 58fc9dc70..089a6aef8 100644 --- a/Telegram/SourceFiles/rpl/range.h +++ b/Telegram/SourceFiles/rpl/range.h @@ -56,6 +56,18 @@ inline producer vector(std::vector &&values) { }; } +template +inline producer vector(std::vector &&values) { + return [values = std::move(values)]( + const consumer &consumer) mutable { + for (auto value : values) { + consumer.put_next_copy(value); + } + consumer.put_done(); + return lifetime(); + }; +} + template inline producer range(Range &&range) { return vector(std::vector( diff --git a/Telegram/SourceFiles/ui/rp_widget.h b/Telegram/SourceFiles/ui/rp_widget.h index fce9f5f38..53697428b 100644 --- a/Telegram/SourceFiles/ui/rp_widget.h +++ b/Telegram/SourceFiles/ui/rp_widget.h @@ -41,7 +41,7 @@ public: rpl::producer geometryValue() const { auto &stream = eventStreams().geometry; - return stream.events_starting_with_copy(geometry()); + return stream.events_starting_with_copy(this->geometry()); } rpl::producer sizeValue() const { return geometryValue() @@ -88,7 +88,7 @@ public: void showOn(rpl::producer &&shown) { std::move(shown) | rpl::start([this](bool visible) { - setVisible(visible); + this->setVisible(visible); }, lifetime()); } @@ -103,7 +103,7 @@ protected: case QEvent::Resize: if (auto streams = _eventStreams.get()) { auto that = weak(this); - streams->geometry.fire_copy(geometry()); + streams->geometry.fire_copy(this->geometry()); if (!that) { return true; } diff --git a/Telegram/gyp/refresh.sh b/Telegram/gyp/refresh.sh index d9e90a16b..f16d9f414 100755 --- a/Telegram/gyp/refresh.sh +++ b/Telegram/gyp/refresh.sh @@ -28,7 +28,7 @@ else #gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode-ninja #gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode # use patched gyp with Xcode project generator - ../../../Libraries/gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out -Gxcode_upgrade_check_project_version=830 -Dofficial_build_target=$BuildTarget Telegram.gyp --format=xcode + ../../../Libraries/gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out -Gxcode_upgrade_check_project_version=900 -Dofficial_build_target=$BuildTarget Telegram.gyp --format=xcode fi cd ../.. diff --git a/docs/building-xcode-old.md b/docs/building-xcode-old.md index af6367ad4..7ba63ad27 100644 --- a/docs/building-xcode-old.md +++ b/docs/building-xcode-old.md @@ -1,4 +1,4 @@ -## Build instructions for Xcode 7.2.1 +## Build instructions for Xcode 9.0 **NB** These are outdated, please refer to [Building using Xcode][xcode] instructions. diff --git a/docs/building-xcode.md b/docs/building-xcode.md index 9fa0d7420..f8fc7b6d2 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -1,4 +1,4 @@ -## Build instructions for Xcode 8.0 +## Build instructions for Xcode 9.0 ### Prepare folder