mirror of https://github.com/procxx/kepka.git
Made to compile by MSVC 2015/2017 32 bit compilers (#101)
Patches by @anatoly-spb : 1. Get rid of -DWIN64, -DZLIB_WINAPI in 32-bit build for fixing zlib linkage; 2. Work around MSVC2015 limitation based on lacking the C++14 features (like void as literal type) and document it.
This commit is contained in:
parent
7320149f22
commit
b1c7c6fc61
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -54,4 +54,4 @@ void as_const(const T&&) = delete;
|
|||
#include <cstdint>
|
||||
|
||||
#define qsl(s) QStringLiteral(s)
|
||||
#define qstr(s) QLatin1String(s, sizeof(s) - 1)
|
||||
#define qstr(s) QLatin1String(s, static_cast<int>(sizeof(s)-1))
|
||||
|
|
Loading…
Reference in New Issue