From 66e50f02dde92f802bbd3a8d79c6352954665b9b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 20 Aug 2018 16:52:11 -0700 Subject: [PATCH] Fix compiler errors and mint v2.10.6 --- Build/version.props | 2 +- Release/CMakeLists.txt | 2 +- Release/include/cpprest/asyncrt_utils.h | 8 +------- Release/include/cpprest/details/cpprest_compat.h | 3 +++ Release/include/cpprest/version.h | 2 +- Release/src/http/client/http_client_winhttp.cpp | 2 +- Release/src/http/common/x509_cert_utilities.h | 4 ++-- Release/src/utilities/asyncrt_utils.cpp | 8 ++++---- changelog.md | 5 +++++ 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Build/version.props b/Build/version.props index 8f840c5f3d..2b67f6647e 100644 --- a/Build/version.props +++ b/Build/version.props @@ -4,7 +4,7 @@ cpprest 2 10 - 4 + 6 $(CppRestSDKVersionMajor)_$(CppRestSDKVersionMinor) $(CppRestSDKVersionMajor).$(CppRestSDKVersionMinor) diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index c93d3cc498..3b99b85309 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -11,7 +11,7 @@ endif() set(CPPREST_VERSION_MAJOR 2) set(CPPREST_VERSION_MINOR 10) -set(CPPREST_VERSION_REVISION 4) +set(CPPREST_VERSION_REVISION 6) enable_testing() diff --git a/Release/include/cpprest/asyncrt_utils.h b/Release/include/cpprest/asyncrt_utils.h index b4b6c591f4..21c92de294 100644 --- a/Release/include/cpprest/asyncrt_utils.h +++ b/Release/include/cpprest/asyncrt_utils.h @@ -359,13 +359,7 @@ namespace details inline bool __cdecl is_alnum(const unsigned char uch) CPPREST_NOEXCEPT { // test if uch is an alnum character // special casing char to avoid branches - static - #if !defined(_MSC_VER) || _MSC_VER >= 1900 - constexpr - #else - const - #endif - bool is_alnum_table[UCHAR_MAX + 1] = + static CPPREST_CONSTEXPR bool is_alnum_table[UCHAR_MAX + 1] = { /* X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF */ /* 0X */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/Release/include/cpprest/details/cpprest_compat.h b/Release/include/cpprest/details/cpprest_compat.h index 7b4f3c1842..1c48552eff 100644 --- a/Release/include/cpprest/details/cpprest_compat.h +++ b/Release/include/cpprest/details/cpprest_compat.h @@ -18,8 +18,10 @@ #if _MSC_VER >= 1900 #define CPPREST_NOEXCEPT noexcept +#define CPPREST_CONSTEXPR constexpr #else #define CPPREST_NOEXCEPT +#define CPPREST_CONSTEXPR const #endif #define CASABLANCA_UNREFERENCED_PARAMETER(x) (x) @@ -36,6 +38,7 @@ #define __assume(x) do { if (!(x)) __builtin_unreachable(); } while (false) #define CASABLANCA_UNREFERENCED_PARAMETER(x) (void)x #define CPPREST_NOEXCEPT noexcept +#define CPPREST_CONSTEXPR constexpr #include #define _ASSERTE(x) assert(x) diff --git a/Release/include/cpprest/version.h b/Release/include/cpprest/version.h index df0f99cf45..cb47ab9d05 100644 --- a/Release/include/cpprest/version.h +++ b/Release/include/cpprest/version.h @@ -3,7 +3,7 @@ * Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. * */ -#define CPPREST_VERSION_REVISION 5 +#define CPPREST_VERSION_REVISION 6 #define CPPREST_VERSION_MINOR 10 #define CPPREST_VERSION_MAJOR 2 diff --git a/Release/src/http/client/http_client_winhttp.cpp b/Release/src/http/client/http_client_winhttp.cpp index 83a60d6ce5..a1f69ab215 100644 --- a/Release/src/http/client/http_client_winhttp.cpp +++ b/Release/src/http/client/http_client_winhttp.cpp @@ -33,7 +33,7 @@ struct security_failure_message const char * text; }; -constexpr security_failure_message g_security_failure_messages[] = { +CPPREST_CONSTEXPR security_failure_message g_security_failure_messages[] = { { WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED, "WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED failed to check revocation status."}, { WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT, diff --git a/Release/src/http/common/x509_cert_utilities.h b/Release/src/http/common/x509_cert_utilities.h index 581a5189c4..9884b05993 100644 --- a/Release/src/http/common/x509_cert_utilities.h +++ b/Release/src/http/common/x509_cert_utilities.h @@ -27,7 +27,7 @@ namespace details struct winhttp_cert_context { PCCERT_CONTEXT raw; - winhttp_cert_context() noexcept : raw(nullptr) {} + winhttp_cert_context() CPPREST_NOEXCEPT : raw(nullptr) {} winhttp_cert_context(const winhttp_cert_context&) = delete; winhttp_cert_context& operator=(const winhttp_cert_context&) = delete; ~winhttp_cert_context() @@ -44,7 +44,7 @@ struct winhttp_cert_context struct winhttp_cert_chain_context { PCCERT_CHAIN_CONTEXT raw; - winhttp_cert_chain_context() noexcept : raw(nullptr) {} + winhttp_cert_chain_context() CPPREST_NOEXCEPT : raw(nullptr) {} winhttp_cert_chain_context(const winhttp_cert_chain_context&) = delete; winhttp_cert_chain_context& operator=(const winhttp_cert_chain_context&) = delete; ~winhttp_cert_chain_context() diff --git a/Release/src/utilities/asyncrt_utils.cpp b/Release/src/utilities/asyncrt_utils.cpp index 72f12ccf10..3faffd1e40 100644 --- a/Release/src/utilities/asyncrt_utils.cpp +++ b/Release/src/utilities/asyncrt_utils.cpp @@ -51,7 +51,7 @@ namespace } }; - constexpr to_lower_ch_impl to_lower_ch{}; + CPPREST_CONSTEXPR to_lower_ch_impl to_lower_ch{}; struct eq_lower_ch_impl { @@ -62,7 +62,7 @@ namespace } }; - constexpr eq_lower_ch_impl eq_lower_ch{}; + CPPREST_CONSTEXPR eq_lower_ch_impl eq_lower_ch{}; struct lt_lower_ch_impl { @@ -73,8 +73,8 @@ namespace } }; - constexpr lt_lower_ch_impl lt_lower_ch{}; -} + CPPREST_CONSTEXPR lt_lower_ch_impl lt_lower_ch{}; + } namespace utility { diff --git a/changelog.md b/changelog.md index 569401e517..dd190b70a9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +cpprestsdk (2.10.6) +---------------------- +* PR#844 Fix clang build error +-- cpprestsdk team MON, 30 Aug 2018 16:51:00 -0800 + cpprestsdk (2.10.5) ---------------------- * Issue#842 Fix incorrect `cpprest/version.h`