Skip to content

Commit

Permalink
fix few more ci checks
Browse files Browse the repository at this point in the history
Signed-off-by: Harinath Nampally <[email protected]>
  • Loading branch information
hnampally committed Jan 20, 2025
1 parent 4ebebad commit 0083937
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <nlohmann/json.hpp>

#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
#if !defined(JSON_NOEXCEPTION) && !defined(JSON_THROW_USER) && !defined(JSON_THROW)
#define JSON_THROW(exception) throw exception
#else
#include <cstdlib>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <iostream>
#include <nlohmann/json.hpp>

#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
#if !defined(JSON_NOEXCEPTION) && !defined(JSON_THROW_USER) && !defined(JSON_THROW)
#define JSON_THROW(exception) throw exception
#else
#include <cstdlib>
Expand Down
14 changes: 4 additions & 10 deletions tests/src/unit-conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,16 +1657,7 @@ TEST_CASE("JSON to enum mapping")
}
}

#ifdef __cpp_exceptions
#undef __cpp_exceptions
#define __cpp_exceptions 1
#endif

#ifdef JSON_NOEXCEPTION
#define JSON_NOEXCEPTION 0
#endif

#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
#if !defined(JSON_NOEXCEPTION) && !defined(JSON_THROW_USER) && !defined(JSON_THROW)
#define JSON_THROW(exception) throw exception
#else
#include <cstdlib>
Expand Down Expand Up @@ -1738,6 +1729,9 @@ TEST_CASE("JSON to enum mapping")
CHECK_THROWS_WITH_AS(j.template get<TaskStateStrict>(), "[json.exception.type_error.302] can't deserialize - invalid json value : \"foo\"", json::type_error);
}
}
#if defined(JSON_THROW)
#undef JSON_THROW
#endif

#ifdef JSON_HAS_CPP_17
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
Expand Down

0 comments on commit 0083937

Please sign in to comment.