Add VS2013 support back.

This commit is contained in:
Chunting Gu
2019-04-09 15:39:58 +08:00
parent ee435f84c3
commit ba705e930e
6 changed files with 82 additions and 5 deletions
+32 -1
View File
@@ -5,6 +5,37 @@
#include <exception>
#include <string>
// -----------------------------------------------------------------------------
// Macros
#ifdef _MSC_VER
#if _MSC_VER <= 1800 // VS 2013
// Does the compiler support "= default" for move copy constructor and
// move assignment operator?
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 0
#define WEBCC_NOEXCEPT
#else
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 1
#define WEBCC_NOEXCEPT noexcept
#endif // _MSC_VER <= 1800
#else
// GCC, Clang, etc.
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 1
#define WEBCC_NOEXCEPT noexcept
#endif // _MSC_VER
namespace webcc {
// -----------------------------------------------------------------------------
@@ -183,7 +214,7 @@ public:
Error error() const { return error_; }
// Note that `noexcept` is required by GCC.
const char* what() const noexcept override {
const char* what() const WEBCC_NOEXCEPT override{
return msg_.c_str();
}