Remove FMT_*_DETAIL_NAMESPACE

This commit is contained in:
Victor Zverovich 2023-05-28 07:33:26 -07:00
parent 6be36af0d4
commit bd393456ed
5 changed files with 18 additions and 24 deletions

View File

@ -530,7 +530,7 @@ inline std::tm gmtime(
return gmtime(std::chrono::system_clock::to_time_t(time_point));
}
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
// DEPRECATED!
template <typename Char>
@ -1997,7 +1997,7 @@ struct chrono_formatter {
}
};
FMT_END_DETAIL_NAMESPACE
} // namespace detail
#if defined(__cpp_lib_chrono) && __cpp_lib_chrono >= 201907
using weekday = std::chrono::weekday;
@ -2142,8 +2142,8 @@ struct formatter<std::chrono::time_point<std::chrono::system_clock, Duration>,
epoch - std::chrono::duration_cast<std::chrono::seconds>(epoch));
if (subsecs.count() < 0) {
auto second = std::chrono::duration_cast<Duration>(
std::chrono::seconds(1));
auto second =
std::chrono::duration_cast<Duration>(std::chrono::seconds(1));
if (epoch.count() < ((Duration::min)() + second).count())
FMT_THROW(format_error("duration is too small"));
subsecs += second;

View File

@ -203,7 +203,7 @@ struct rgb {
uint8_t b;
};
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
// color is a struct of either a rgb color or a terminal color.
struct color_type {
@ -225,8 +225,7 @@ struct color_type {
uint32_t rgb_color;
} value;
};
FMT_END_DETAIL_NAMESPACE
} // namespace detail
/** A text style consisting of foreground and background colors and emphasis. */
class text_style {
@ -323,7 +322,7 @@ FMT_CONSTEXPR inline text_style operator|(emphasis lhs, emphasis rhs) noexcept {
return text_style(lhs) | rhs;
}
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
template <typename Char> struct ansi_color_escape {
FMT_CONSTEXPR ansi_color_escape(detail::color_type text_color,
@ -457,7 +456,7 @@ void vformat_to(buffer<Char>& buf, const text_style& ts,
if (has_style) detail::reset_color<Char>(buf);
}
FMT_END_DETAIL_NAMESPACE
} // namespace detail
inline void vprint(std::FILE* f, const text_style& ts, string_view fmt,
format_args args) {

View File

@ -48,11 +48,6 @@
#include "core.h"
#ifndef FMT_BEGIN_DETAIL_NAMESPACE
# define FMT_BEGIN_DETAIL_NAMESPACE namespace detail {
# define FMT_END_DETAIL_NAMESPACE }
#endif
#if defined __cpp_inline_variables && __cpp_inline_variables >= 201606L
# define FMT_INLINE_VARIABLE inline
#else
@ -1126,7 +1121,7 @@ template <typename Locale> class format_facet : public Locale::facet {
}
};
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
// Returns true if value is negative, false otherwise.
// Same as `value < 0` but doesn't produce warnings if T is an unsigned type.
@ -3893,7 +3888,7 @@ FMT_API void format_error_code(buffer<char>& out, int error_code,
FMT_API void report_error(format_func func, int error_code,
const char* message) noexcept;
FMT_END_DETAIL_NAMESPACE
} // namespace detail
FMT_API auto vsystem_error(int error_code, string_view format_str,
format_args args) -> std::system_error;
@ -4264,7 +4259,7 @@ FMT_NODISCARD auto to_string(const basic_memory_buffer<Char, SIZE>& buf)
return std::basic_string<Char>(buf.data(), size);
}
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
template <typename Char>
void vformat_to(buffer<Char>& buf, basic_string_view<Char> fmt,
@ -4347,7 +4342,7 @@ extern template FMT_API auto decimal_point_impl(locale_ref) -> char;
extern template FMT_API auto decimal_point_impl(locale_ref) -> wchar_t;
#endif // FMT_HEADER_ONLY
FMT_END_DETAIL_NAMESPACE
} // namespace detail
#if FMT_USE_USER_DEFINED_LITERALS
inline namespace literals {

View File

@ -123,10 +123,10 @@ using wcstring_view = basic_cstring_view<wchar_t>;
#ifdef _WIN32
FMT_API const std::error_category& system_category() noexcept;
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
FMT_API void format_windows_error(buffer<char>& out, int error_code,
const char* message) noexcept;
FMT_END_DETAIL_NAMESPACE
}
FMT_API std::system_error vwindows_error(int error_code, string_view format_str,
format_args args);
@ -328,7 +328,7 @@ class FMT_API file {
// Returns the memory page size.
long getpagesize();
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
struct buffer_size {
buffer_size() = default;
@ -387,7 +387,7 @@ class file_buffer final : public buffer<char> {
}
};
FMT_END_DETAIL_NAMESPACE
} // namespace detail
// Added {} below to work around default constructor error known to
// occur in Xcode versions 7.2.1 and 8.2.1.

View File

@ -52,7 +52,7 @@ template <typename Char> class basic_printf_context {
}
};
FMT_BEGIN_DETAIL_NAMESPACE
namespace detail {
// Checks if a value fits in int - used to avoid warnings about comparing
// signed and unsigned integers.
@ -553,7 +553,7 @@ void vprintf(buffer<Char>& buf, basic_string_view<Char> format,
}
write(out, basic_string_view<Char>(start, to_unsigned(it - start)));
}
FMT_END_DETAIL_NAMESPACE
} // namespace detail
using printf_context = basic_printf_context<char>;
using wprintf_context = basic_printf_context<wchar_t>;