diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 6f52329f3..8ec40f3b6 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -582,9 +582,9 @@ endif() if (WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_USING_V110_SDK71_ - -DWIN32 -D_WINDOWS -D_UNICODE -DUNICODE -DWIN64 + -DWIN32 -D_WINDOWS -D_UNICODE -DUNICODE -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP - -DHAVE_STDINT_H -DZLIB_WINAPI) + -DHAVE_STDINT_H) endif() add_definitions(-DAL_LIBTYPE_STATIC) diff --git a/Telegram/SourceFiles/base/assertion.h b/Telegram/SourceFiles/base/assertion.h index 33de049a9..1711e1504 100644 --- a/Telegram/SourceFiles/base/assertion.h +++ b/Telegram/SourceFiles/base/assertion.h @@ -43,10 +43,17 @@ inline constexpr void noop() { std::abort(); } -inline constexpr void validate(bool condition, const char *message, const char *file, int line) { +// Since MSVC 2015 cannot understand "constexpr void" (void is literal since C++14) +// we have to use conditional compilation +inline +#if !defined(_MSC_VER) || (_MSC_VER > 1900) +constexpr +#endif + void validate(bool condition, const char *message, const char *file, int line) { (GSL_UNLIKELY(!(condition))) ? fail(message, file, line) : noop(); } + } // namespace assertion } // namespace base diff --git a/Telegram/SourceFiles/core/basic_types.h b/Telegram/SourceFiles/core/basic_types.h index 2259cbba0..d8279bb6c 100644 --- a/Telegram/SourceFiles/core/basic_types.h +++ b/Telegram/SourceFiles/core/basic_types.h @@ -54,4 +54,4 @@ void as_const(const T&&) = delete; #include #define qsl(s) QStringLiteral(s) -#define qstr(s) QLatin1String(s, sizeof(s) - 1) +#define qstr(s) QLatin1String(s, static_cast(sizeof(s)-1))