Fix compilation with VS2015 (#1450)

VS2015 does not support the __pragma(...) syntax in the midst of a
class declaration, so move it to just before the declaration.
This commit is contained in:
iPherian 2019-12-10 02:18:40 -08:00
parent 6d2491b3bf
commit 2a10d75b16
No known key found for this signature in database
GPG Key ID: B99792E7B44C0609
2 changed files with 8 additions and 2 deletions

View File

@ -171,13 +171,17 @@
# else # else
# define FMT_NO_W4275 # define FMT_NO_W4275
# endif # endif
# define FMT_CLASS_API FMT_NO_W4275
# ifdef FMT_EXPORT # ifdef FMT_EXPORT
# define FMT_API FMT_NO_W4275 __declspec(dllexport) # define FMT_API __declspec(dllexport)
# elif defined(FMT_SHARED) # elif defined(FMT_SHARED)
# define FMT_API FMT_NO_W4275 __declspec(dllimport) # define FMT_API __declspec(dllimport)
# define FMT_EXTERN_TEMPLATE_API FMT_API # define FMT_EXTERN_TEMPLATE_API FMT_API
# endif # endif
#endif #endif
#ifndef FMT_CLASS_API
# define FMT_CLASS_API
#endif
#ifndef FMT_API #ifndef FMT_API
# define FMT_API # define FMT_API
#endif #endif

View File

@ -688,6 +688,7 @@ using memory_buffer = basic_memory_buffer<char>;
using wmemory_buffer = basic_memory_buffer<wchar_t>; using wmemory_buffer = basic_memory_buffer<wchar_t>;
/** A formatting error such as invalid format string. */ /** A formatting error such as invalid format string. */
FMT_CLASS_API
class FMT_API format_error : public std::runtime_error { class FMT_API format_error : public std::runtime_error {
public: public:
explicit format_error(const char* message) : std::runtime_error(message) {} explicit format_error(const char* message) : std::runtime_error(message) {}
@ -2699,6 +2700,7 @@ class arg_formatter : public internal::arg_formatter_base<Range> {
An error returned by an operating system or a language runtime, An error returned by an operating system or a language runtime,
for example a file opening error. for example a file opening error.
*/ */
FMT_CLASS_API
class FMT_API system_error : public std::runtime_error { class FMT_API system_error : public std::runtime_error {
private: private:
void init(int err_code, string_view format_str, format_args args); void init(int err_code, string_view format_str, format_args args);