Make MinGW work with noreturn attribute
This commit is contained in:
parent
ffa45de992
commit
e792f1726b
15
fmt/format.h
15
fmt/format.h
@ -139,6 +139,15 @@ typedef __int64 intmax_t;
|
|||||||
# define FMT_HAS_CPP_ATTRIBUTE(x) 0
|
# define FMT_HAS_CPP_ATTRIBUTE(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Use the compiler's attribute noreturn
|
||||||
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
# define FMT_NORETURN __attribute__((noreturn))
|
||||||
|
#elif FMT_HAS_CPP_ATTRIBUTE(noreturn)
|
||||||
|
# define FMT_NORETURN [[noreturn]]
|
||||||
|
#else
|
||||||
|
# define FMT_NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FMT_USE_VARIADIC_TEMPLATES
|
#ifndef FMT_USE_VARIADIC_TEMPLATES
|
||||||
// Variadic templates are available in GCC since version 4.4
|
// Variadic templates are available in GCC since version 4.4
|
||||||
// (http://gcc.gnu.org/projects/cxx0x.html) and in Visual C++
|
// (http://gcc.gnu.org/projects/cxx0x.html) and in Visual C++
|
||||||
@ -923,11 +932,7 @@ struct IntTraits {
|
|||||||
TypeSelector<std::numeric_limits<T>::digits <= 32>::Type MainType;
|
TypeSelector<std::numeric_limits<T>::digits <= 32>::Type MainType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if FMT_HAS_CPP_ATTRIBUTE(noreturn)
|
FMT_API FMT_NORETURN void report_unknown_type(char code, const char *type);
|
||||||
FMT_API [[noreturn]] void report_unknown_type(char code, const char *type);
|
|
||||||
#else
|
|
||||||
FMT_API void report_unknown_type(char code, const char *type);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Static data is placed in this class template to allow header-only
|
// Static data is placed in this class template to allow header-only
|
||||||
// configuration.
|
// configuration.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user