Skip to content

Commit

Permalink
fix: Stop suppressing fmtlib exceptions
Browse files Browse the repository at this point in the history
It can't be worse than terminating.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Aug 27, 2024
1 parent 8699b96 commit a66a4f6
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/include/OpenImageIO/detail/fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@
# define FMT_HEADER_ONLY
#endif

// Disable fmt exceptions
#ifndef FMT_EXCEPTIONS
# define FMT_EXCEPTIONS 0
#endif

// Redefining FMT_THROW to something benign seems to avoid some UB or possibly
// gcc 11+ compiler bug triggered by the definition of FMT_THROW in fmt 10.1+
// when FMT_EXCEPTIONS=0, which results in mangling SIMD math. This nugget
// below works around the problems for hard to understand reasons.
#if !defined(FMT_THROW) && !FMT_EXCEPTIONS && OIIO_GNUC_VERSION >= 110000
# define FMT_THROW(x) \
OIIO_ASSERT_MSG(0, "fmt exception: %s", (x).what()), std::terminate()
#endif

// Use the grisu fast floating point formatting for old fmt versions
// (irrelevant for >= 7.1).
#ifndef FMT_USE_GRISU
Expand Down

0 comments on commit a66a4f6

Please sign in to comment.