mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-24 19:29:47 +01:00
Move FMT_API from ostream class to members (#4584)
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 https://github.com/fmtlib/fmt/issues/4576
This commit is contained in:
@@ -365,17 +365,17 @@ FMT_INLINE_VARIABLE constexpr auto buffer_size = detail::buffer_size();
|
|||||||
|
|
||||||
/// A fast buffered output stream for writing from a single thread. Writing from
|
/// A fast buffered output stream for writing from a single thread. Writing from
|
||||||
/// multiple threads without external synchronization may result in a data race.
|
/// multiple threads without external synchronization may result in a data race.
|
||||||
class FMT_API ostream : private detail::buffer<char> {
|
class ostream : private detail::buffer<char> {
|
||||||
private:
|
private:
|
||||||
file file_;
|
file file_;
|
||||||
|
|
||||||
ostream(cstring_view path, const detail::ostream_params& params);
|
FMT_API ostream(cstring_view path, const detail::ostream_params& params);
|
||||||
|
|
||||||
static void grow(buffer<char>& buf, size_t);
|
FMT_API static void grow(buffer<char>& buf, size_t);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ostream(ostream&& other) noexcept;
|
FMT_API ostream(ostream&& other) noexcept;
|
||||||
~ostream();
|
FMT_API ~ostream();
|
||||||
|
|
||||||
operator writer() {
|
operator writer() {
|
||||||
detail::buffer<char>& buf = *this;
|
detail::buffer<char>& buf = *this;
|
||||||
|
|||||||
Reference in New Issue
Block a user