mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-02 12:06:11 +00:00
Cleanup handling of visibility
This commit is contained in:
parent
016b1faede
commit
6c088be8ec
@ -185,18 +185,20 @@
|
||||
# define FMT_END_EXPORT
|
||||
#endif
|
||||
|
||||
#if FMT_GCC_VERSION || defined(__clang__)
|
||||
# define FMT_VISIBILITY(value) __attribute__((visibility(value)))
|
||||
#else
|
||||
# define FMT_VISIBILITY(value)
|
||||
#endif
|
||||
|
||||
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
||||
# ifdef FMT_LIB_EXPORT
|
||||
# define FMT_API __declspec(dllexport)
|
||||
# elif defined(FMT_SHARED)
|
||||
# define FMT_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# if defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
|
||||
# if defined(__GNUC__) || defined(__clang__)
|
||||
# define FMT_API __attribute__((visibility("default")))
|
||||
# endif
|
||||
# endif
|
||||
#elif defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
|
||||
# define FMT_API FMT_VISIBILITY("default")
|
||||
#endif
|
||||
#ifndef FMT_API
|
||||
# define FMT_API
|
||||
|
@ -93,17 +93,11 @@
|
||||
# define FMT_NO_UNIQUE_ADDRESS
|
||||
#endif
|
||||
|
||||
#if FMT_GCC_VERSION || defined(__clang__)
|
||||
# define FMT_VISIBILITY(value) __attribute__((visibility(value)))
|
||||
// Visibility when compiled as a shared library/object.
|
||||
#if defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
|
||||
# define FMT_SO_VISIBILITY(value) FMT_VISIBILITY(value)
|
||||
#else
|
||||
# define FMT_VISIBILITY(value)
|
||||
#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
|
||||
# define FMT_SO_VISIBILITY(value)
|
||||
#endif
|
||||
|
||||
#ifdef __has_builtin
|
||||
@ -1053,7 +1047,7 @@ FMT_BEGIN_EXPORT
|
||||
#endif
|
||||
|
||||
/** An error reported from a formatting function. */
|
||||
class FMT_INLINE_API format_error : public std::runtime_error {
|
||||
class FMT_SO_VISIBILITY("default") format_error : public std::runtime_error {
|
||||
public:
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user