Skip to content

Remove FMT_API from ostream class to members - #4584

Merged
vitaut merged 1 commit into
fmtlib:masterfrom
FatihBAKIR:os-fmt-api-fix
Oct 20, 2025
Merged

Remove FMT_API from ostream class to members#4584
vitaut merged 1 commit into
fmtlib:masterfrom
FatihBAKIR:os-fmt-api-fix

Conversation

@FatihBAKIR

Copy link
Copy Markdown
Contributor

Putting FMT_API on the class definition propagates it to the base class detail::buffer's members. However, MSVC not emit definitions for inline members unless it sees the symbols as FMT_API when compiling.

This fix removes the FMT_API declaration from the class itself and marks individual non-inline members as FMT_API to address the issue.

Fixes #4576

@vitaut

vitaut commented Oct 19, 2025

Copy link
Copy Markdown
Contributor

It was not just formatting but a build breakage due to a botched merge, please rebase past a2289b8.

Putting FMT_API on the class definition propagates it to the base class
detail::buffer<char>'s members. However, MSVC not emit definitions for
inline members unless it sees the symbols as FMT_API when compiling.

This fix removes the FMT_API declaration from the class itself and marks
individual non-inline members as FMT_API to address the issue.

Fixes fmtlib#4576
@vitaut
vitaut merged commit d6bdb69 into fmtlib:master Oct 20, 2025
41 checks passed
@vitaut

vitaut commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

Thank you!