diff --git a/.gitignore b/.gitignore index 4928acf931..63873b949b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ *.xcodeproj /Win32/ ipch/ +.vs/ /Telegram/log.txt /Telegram/data diff --git a/Telegram/SourceFiles/base/assertion.h b/Telegram/SourceFiles/base/assertion.h index 34b8f77626..33de049a97 100644 --- a/Telegram/SourceFiles/base/assertion.h +++ b/Telegram/SourceFiles/base/assertion.h @@ -29,7 +29,7 @@ namespace assertion { void log(const char *message, const char *file, int line); // Release build assertions. -inline void noop() { +inline constexpr void noop() { } [[noreturn]] inline void fail(const char *message, const char *file, int line) { @@ -43,7 +43,7 @@ inline void noop() { std::abort(); } -inline void validate(bool condition, const char *message, const char *file, int line) { +inline constexpr void validate(bool condition, const char *message, const char *file, int line) { (GSL_UNLIKELY(!(condition))) ? fail(message, file, line) : noop(); } diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 051768ae16..cd06a8ead4 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -695,7 +695,7 @@ private: SendTyping = (1 << 1), }; using TextUpdateEvents = base::flags; - friend inline constexpr auto is_flag_type(TextUpdateEvent) { return true; }; + friend inline constexpr bool is_flag_type(TextUpdateEvent) { return true; }; void writeDrafts(Data::Draft **localDraft, Data::Draft **editDraft); void writeDrafts(History *history); diff --git a/Telegram/ThirdParty/libtgvoip b/Telegram/ThirdParty/libtgvoip index 757a5d8ec3..9f78cb85e5 160000 --- a/Telegram/ThirdParty/libtgvoip +++ b/Telegram/ThirdParty/libtgvoip @@ -1 +1 @@ -Subproject commit 757a5d8ec31aadcf387ac3cb135256152c18de1c +Subproject commit 9f78cb85e5db9b39a6c4c3f7847ea3e98c9f544a diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp index 9a0c436df5..6fa545e5d1 100644 --- a/Telegram/gyp/Telegram.gyp +++ b/Telegram/gyp/Telegram.gyp @@ -98,7 +98,7 @@ '<(libs_loc)/breakpad/src', '<(libs_loc)/lzma/C', '<(libs_loc)/libexif-0.6.20', - '<(libs_loc)/zlib-1.2.8', + '<(libs_loc)/zlib', '<(libs_loc)/ffmpeg', '<(libs_loc)/openal-soft/include', '<(libs_loc)/opus/include', diff --git a/Telegram/gyp/refresh.bat b/Telegram/gyp/refresh.bat index 1c820ea09d..3622ced93b 100644 --- a/Telegram/gyp/refresh.bat +++ b/Telegram/gyp/refresh.bat @@ -25,7 +25,7 @@ if not "%TDESKTOP_BUILD_DEFINES%" == "" ( echo [INFO] Set build defines to !BUILD_DEFINES! ) -set GYP_MSVS_VERSION=2015 +set GYP_MSVS_VERSION=2017 cd "%FullScriptPath%" call gyp --depth=. --generator-output=.. -Goutput_dir=../out !BUILD_DEFINES! -Dofficial_build_target=%BuildTarget% Telegram.gyp --format=ninja diff --git a/Telegram/gyp/settings_win.gypi b/Telegram/gyp/settings_win.gypi index 360765063a..66ffa9fd6e 100644 --- a/Telegram/gyp/settings_win.gypi +++ b/Telegram/gyp/settings_win.gypi @@ -40,6 +40,7 @@ '/MP', # Enable multi process build. '/EHsc', # Catch C++ exceptions only, extern C functions never throw a C++ exception. '/WX', # Treat warnings as errors. + '/std:c++latest', ], 'TreatWChar_tAsBuiltInType': 'false', }, diff --git a/Telegram/gyp/telegram_win.gypi b/Telegram/gyp/telegram_win.gypi index 95b81cd1dc..b4131f6335 100644 --- a/Telegram/gyp/telegram_win.gypi +++ b/Telegram/gyp/telegram_win.gypi @@ -21,7 +21,7 @@ 'conditions': [[ 'build_win', { 'msvs_precompiled_source': '<(src_loc)/stdafx.cpp', 'msvs_precompiled_header': '<(src_loc)/stdafx.h', - 'msbuild_toolset': 'v140', + 'msbuild_toolset': 'v141', 'sources': [ '<(res_loc)/winrc/Telegram.rc', ], @@ -36,13 +36,12 @@ '-lLzmaLib', '-lUxTheme', '-lDbgHelp', - '-llib_exif', '-lOpenAL32', '-lcommon', '-lopus', - 'lib/common', - 'lib/exception_handler', - 'lib/crash_generation_client', + 'windows/common', + 'windows/handler/exception_handler', + 'windows/crash_generation/crash_generation_client', ], 'msvs_settings': { 'VCLinkerTool': { @@ -58,16 +57,15 @@ 'configurations': { 'Debug': { 'include_dirs': [ - '<(libs_loc)/openssl_debug/Debug/include', + '<(libs_loc)/openssl/Debug/include', ], 'library_dirs': [ - '<(libs_loc)/openssl_debug/Debug/lib', + '<(libs_loc)/openssl/Debug/lib', '<(libs_loc)/lzma/C/Util/LzmaLib/Debug', - '<(libs_loc)/libexif-0.6.20/win32/Debug', '<(libs_loc)/opus/win32/VS2015/Win32/Debug', '<(libs_loc)/openal-soft/build/Debug', - '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatDebug', - '<(libs_loc)/breakpad/src/client/windows/Debug', + '<(libs_loc)/zlib/contrib/vstudio/vc14/x86/ZlibStatDebug', + '<(libs_loc)/breakpad/src/out/Debug/obj/client', ], }, 'Release': { @@ -77,11 +75,10 @@ 'library_dirs': [ '<(libs_loc)/openssl/Release/lib', '<(libs_loc)/lzma/C/Util/LzmaLib/Release', - '<(libs_loc)/libexif-0.6.20/win32/Release', '<(libs_loc)/opus/win32/VS2015/Win32/Release', '<(libs_loc)/openal-soft/build/Release', - '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatRelease', - '<(libs_loc)/breakpad/src/client/windows/Release', + '<(libs_loc)/zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm', + '<(libs_loc)/breakpad/src/out/Release/obj/client', ], }, }, diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp index 209c737043..c7dcb6965d 100644 --- a/Telegram/gyp/utils.gyp +++ b/Telegram/gyp/utils.gyp @@ -110,7 +110,7 @@ 'include_dirs': [ '<(src_loc)', '<(libs_loc)/lzma/C', - '<(libs_loc)/zlib-1.2.8', + '<(libs_loc)/zlib', ], 'sources': [ '<(src_loc)/_other/packer.cpp', @@ -121,12 +121,12 @@ 'conditions': [ [ 'build_win', { 'include_dirs': [ - '<(libs_loc)/openssl_debug/Debug/include', + '<(libs_loc)/openssl/Debug/include', ], 'library_dirs': [ - '<(libs_loc)/openssl_debug/Debug/lib', + '<(libs_loc)/openssl/Debug/lib', '<(libs_loc)/lzma/C/Util/LzmaLib/Debug', - '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatDebug', + '<(libs_loc)/zlib/contrib/vstudio/vc14/x86/ZlibStatDebug', ], }, { 'include_dirs': [ @@ -148,7 +148,7 @@ 'library_dirs': [ '<(libs_loc)/openssl/Release/lib', '<(libs_loc)/lzma/C/Util/LzmaLib/Release', - '<(libs_loc)/zlib-1.2.8/contrib/vstudio/vc11/x86/ZlibStatRelease', + '<(libs_loc)/zlib/contrib/vstudio/vc14/x86/ZlibStatReleaseWithoutAsm', ], }, { 'include_dirs': [