Skip to content

Commit

Permalink
Detect exceptions in a more cross platform manner
Browse files Browse the repository at this point in the history
Works for Clang, Gcc and MSVC
  • Loading branch information
arximboldi committed Sep 17, 2024
1 parent 590da88 commit 167f7b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lager/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
#endif

#if !defined(LAGER_USE_EXCEPTIONS) && !defined(LAGER_NO_EXCEPTIONS)
#ifdef __has_feature
#if !__has_feature(cxx_exceptions)
#if defined(_MSC_VER)
#if !_HAS_EXCEPTIONS
#define LAGER_NO_EXCEPTIONS
#endif
#else
#if !__cpp_exceptions
#define LAGER_NO_EXCEPTIONS
#endif
#endif
Expand All @@ -43,4 +47,3 @@
#define LAGER_THROW(expr) throw expr
#define LAGER_RETHROW throw
#endif

0 comments on commit 167f7b8

Please sign in to comment.