Skip to content

Commit

Permalink
fix(fmt.h): fix build break from recent fmt change (AcademySoftwareFo…
Browse files Browse the repository at this point in the history
…undation#4227)

We disable fmt execptions and force it to do one of our ASSERT's
instead. But fmt in their main branch recently added `[[noreturn]]`
annotations in a way that cause this to be compiler errors for our
overrides. Needed an extra std::terminate() call to guarantee the
noreturn promise.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Apr 15, 2024
1 parent d75a7d4 commit 9e9e80d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/include/OpenImageIO/detail/fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
// 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) && OIIO_GNUC_VERSION >= 110000
# define FMT_THROW(x) OIIO_ASSERT_MSG(0, "fmt exception: %s", (x).what())
#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
Expand Down

0 comments on commit 9e9e80d

Please sign in to comment.