mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-29 03:32:42 +00:00
Fix symbol leak (#3627)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
parent
e25370093a
commit
016b1faede
@ -99,6 +99,13 @@
|
|||||||
# define FMT_VISIBILITY(value)
|
# define FMT_VISIBILITY(value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(FMT_HEADER_ONLY) && !defined(_WIN32) && \
|
||||||
|
(defined(FMT_LIB_EXPORT) || defined(FMT_SHARED))
|
||||||
|
# define FMT_INLINE_API FMT_VISIBILITY("default")
|
||||||
|
#else
|
||||||
|
# define FMT_INLINE_API
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __has_builtin
|
#ifdef __has_builtin
|
||||||
# define FMT_HAS_BUILTIN(x) __has_builtin(x)
|
# define FMT_HAS_BUILTIN(x) __has_builtin(x)
|
||||||
#else
|
#else
|
||||||
@ -1046,7 +1053,7 @@ FMT_BEGIN_EXPORT
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** An error reported from a formatting function. */
|
/** An error reported from a formatting function. */
|
||||||
class FMT_VISIBILITY("default") format_error : public std::runtime_error {
|
class FMT_INLINE_API format_error : public std::runtime_error {
|
||||||
public:
|
public:
|
||||||
using std::runtime_error::runtime_error;
|
using std::runtime_error::runtime_error;
|
||||||
};
|
};
|
||||||
|
@ -443,6 +443,10 @@ TEST(memory_buffer_test, max_size_allocator_overflow) {
|
|||||||
EXPECT_THROW(buffer.resize(161), std::exception);
|
EXPECT_THROW(buffer.resize(161), std::exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(format_test, exception_from_lib) {
|
||||||
|
EXPECT_THROW_MSG(fmt::throw_format_error("test"), format_error, "test");
|
||||||
|
}
|
||||||
|
|
||||||
TEST(format_test, escape) {
|
TEST(format_test, escape) {
|
||||||
EXPECT_EQ("{", fmt::format("{{"));
|
EXPECT_EQ("{", fmt::format("{{"));
|
||||||
EXPECT_EQ("before {", fmt::format("before {{"));
|
EXPECT_EQ("before {", fmt::format("before {{"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user