Skip to content

Commit d223492

Browse files
lgritzscott-wilson
authored andcommitted
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]> Signed-off-by: Scott Wilson <[email protected]>
1 parent b8f19ee commit d223492

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
@@ -616,6 +616,9 @@ struct formatter<OIIO::TypeDesc> {
616616
{
617617
// Get the presentation type, if any. Required to be 's'.
618618
auto it = ctx.begin(), end = ctx.end();
619+
// Skip any width specifier. Remember that this is only for old
620+
// versions of fmt, so just don't sweat it.
621+
while (it != end && isdigit(*it)) ++it;
619622
if (it != end && (*it == 's')) ++it;
620623
// Check if reached the end of the range:
621624
if (it != end && *it != '}')

0 commit comments

Comments
 (0)