From a00149f8ee60a48fe7735d3eecd209b509e2168f Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 16 Jan 2017 22:36:58 +0100 Subject: [PATCH] :bug: fixed logic error --- .travis.yml | 4 ++-- src/json.hpp | 10 +++++----- src/json.hpp.re2c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a154deb..fc7e5db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,13 +78,13 @@ matrix: env: - COMPILER=g++-4.9 - SPECIAL=no_exceptions - - TEST_PATTERN="-e \"*\"" + - TEST_PATTERN=-e "*" addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-4.9, cppcheck] before_script: - - make FLAGS="-fno-exceptions" + - CPPFLAGS="-DJSON_NOEXCEPTION" make # Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/) diff --git a/src/json.hpp b/src/json.hpp index 69d49ec1..fa9b85f2 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -89,14 +89,14 @@ SOFTWARE. #endif // allow to disable exceptions -#if defined(JSON_NOEXCEPTION) || defined(__EXCEPTIONS) - #define JSON_THROW(exception) std::abort() - #define JSON_TRY if(true) - #define JSON_CATCH(exception) if(false) -#else +#if not defined(JSON_NOEXCEPTION) || defined(__EXCEPTIONS) #define JSON_THROW(exception) throw exception #define JSON_TRY try #define JSON_CATCH(exception) catch(exception) +#else + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) #endif /*! diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 31accc98..886b9dde 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -89,14 +89,14 @@ SOFTWARE. #endif // allow to disable exceptions -#if defined(JSON_NOEXCEPTION) || defined(__EXCEPTIONS) - #define JSON_THROW(exception) std::abort() - #define JSON_TRY if(true) - #define JSON_CATCH(exception) if(false) -#else +#if not defined(JSON_NOEXCEPTION) || defined(__EXCEPTIONS) #define JSON_THROW(exception) throw exception #define JSON_TRY try #define JSON_CATCH(exception) catch(exception) +#else + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) #endif /*!