Skip to content

Commit 4d4a30d

Browse files
committed
build: fix failed test with old fmt (AcademySoftwareFoundation#4758)
Our fmath_test (a.k.a. unit_fmath) test was failing with an exception thrown by the fmt library because we used a width specifier when formatting a TypeDesc. It was really only an issue when using old fmt < 10.0, so I'm just solving it trivially by ignoring that specifier for old fmt. It doesn't seem necessary to make it work correctly with width specifiers for old versions, when we don't in any way rely on it. Signed-off-by: Larry Gritz <[email protected]>
1 parent a6e37e3 commit 4d4a30d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/include/OpenImageIO/typedesc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ struct formatter<OIIO::TypeDesc> {
593593
{
594594
// Get the presentation type, if any. Required to be 's'.
595595
auto it = ctx.begin(), end = ctx.end();
596+
// Skip any width specifier. Remember that this is only for old
597+
// versions of fmt, so just don't sweat it.
598+
while (it != end && isdigit(*it)) ++it;
596599
if (it != end && (*it == 's')) ++it;
597600
// Check if reached the end of the range:
598601
if (it != end && *it != '}')

0 commit comments

Comments
 (0)