Skip to content

Commit

Permalink
Fix error: cannot use 'try' with exceptions disabled in Win LLVM Clang (
Browse files Browse the repository at this point in the history
#4208)

Fixes #4207.

LLVM Clang on Windows does not define `__GNUC__`. The preprocessor falls
to `#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS` with `_HAS_EXCEPTIONS 1`
defined in vcruntime.h:104.
  • Loading branch information
sergio-nsk authored Oct 23, 2024
1 parent e9eaa27 commit 4daa3d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
// Use the provided definition.
#elif defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_USE_EXCEPTIONS 0
#elif defined(__clang__) && !defined(__cpp_exceptions)
# define FMT_USE_EXCEPTIONS 0
#elif FMT_MSC_VERSION && !_HAS_EXCEPTIONS
# define FMT_USE_EXCEPTIONS 0
#else
Expand Down

0 comments on commit 4daa3d5

Please sign in to comment.