Deprecate more

This commit is contained in:
Victor Zverovich
2022-01-03 09:56:44 -08:00
parent 8e59744b8d
commit 1b193e7b37
5 changed files with 26 additions and 51 deletions

View File

@@ -219,6 +219,20 @@
# endif
#endif
#ifndef FMT_DEPRECATED
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
# define FMT_DEPRECATED [[deprecated]]
# else
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED /* deprecated */
# endif
# endif
#endif
#ifndef FMT_BEGIN_NAMESPACE
# define FMT_BEGIN_NAMESPACE \
namespace fmt { \
@@ -1373,21 +1387,20 @@ template <typename Context> struct arg_mapper {
using cstring_result = conditional_t<std::is_same<char_type, char>::value,
const char*, unformattable_pointer>;
// DEPRECATED!
FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val) -> cstring_result {
return map(reinterpret_cast<const char*>(val));
}
// DEPRECATED!
FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char* val)
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val)
-> cstring_result {
return map(reinterpret_cast<const char*>(val));
}
// DEPRECATED!
FMT_CONSTEXPR FMT_INLINE auto map(signed char* val) -> cstring_result {
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char* val)
-> cstring_result {
return map(reinterpret_cast<const char*>(val));
}
// DEPRECATED!
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val) -> cstring_result {
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(signed char* val)
-> cstring_result {
return map(reinterpret_cast<const char*>(val));
}
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val)
-> cstring_result {
return map(reinterpret_cast<const char*>(val));
}

View File

@@ -110,20 +110,6 @@ FMT_END_NAMESPACE
# define FMT_CATCH(x) if (false)
#endif
#ifndef FMT_DEPRECATED
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
# define FMT_DEPRECATED [[deprecated]]
# else
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED /* deprecated */
# endif
# endif
#endif
#ifndef FMT_MAYBE_UNUSED
# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused)
# define FMT_MAYBE_UNUSED [[maybe_unused]]