diff --git a/include/quill/bundled/fmt/base.h b/include/quill/bundled/fmt/base.h index 2bc38ab0..6a0331b4 100644 --- a/include/quill/bundled/fmt/base.h +++ b/include/quill/bundled/fmt/base.h @@ -25,7 +25,7 @@ #endif // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMTQUILL_VERSION 110102 +#define FMTQUILL_VERSION 110103 // Detect compiler versions. #if defined(__clang__) && !defined(__ibmxl__) @@ -100,9 +100,9 @@ // Detect C++14 relaxed constexpr. #ifdef FMTQUILL_USE_CONSTEXPR // Use the provided definition. -#elif FMTQUILL_GCC_VERSION >= 600 && FMTQUILL_CPLUSPLUS >= 201402L -// GCC only allows throw in constexpr since version 6: -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67371. +#elif FMTQUILL_GCC_VERSION >= 702 && FMTQUILL_CPLUSPLUS >= 201402L +// GCC only allows constexpr member functions in non-literal types since 7.2: +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297. # define FMTQUILL_USE_CONSTEXPR 1 #elif FMTQUILL_ICC_VERSION # define FMTQUILL_USE_CONSTEXPR 0 // https://github.com/fmtlib/fmt/issues/1628 @@ -303,7 +303,7 @@ // Enable minimal optimizations for more compact code in debug mode. FMTQUILL_PRAGMA_GCC(push_options) -#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) +#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMTQUILL_MODULE) FMTQUILL_PRAGMA_GCC(optimize("Og")) #endif FMTQUILL_PRAGMA_CLANG(diagnostic push) @@ -743,13 +743,15 @@ class basic_specs { max_fill_size = 4 }; - size_t data_ = 1 << fill_size_shift; + unsigned data_ = 1 << fill_size_shift; + static_assert(sizeof(data_) * CHAR_BIT >= 18, ""); // Character (code unit) type is erased to prevent template bloat. char fill_data_[max_fill_size] = {' '}; FMTQUILL_CONSTEXPR void set_fill_size(size_t size) { - data_ = (data_ & ~fill_size_mask) | (size << fill_size_shift); + data_ = (data_ & ~fill_size_mask) | + (static_cast(size) << fill_size_shift); } public: @@ -1123,7 +1125,7 @@ using use_formatter = bool_constant<(std::is_class::value || std::is_enum::value || std::is_union::value || std::is_array::value) && !has_to_string_view::value && !is_named_arg::value && - !use_format_as::value && !use_format_as_member::value>; + !use_format_as::value && !use_format_as_member::value>; template > auto has_formatter_impl(T* p, buffered_context* ctx = nullptr) @@ -2671,6 +2673,7 @@ class context { FMTQUILL_CONSTEXPR auto arg_id(string_view name) const -> int { return args_.get_id(name); } + auto args() const -> const format_args& { return args_; } // Returns an iterator to the beginning of the output range. FMTQUILL_CONSTEXPR auto out() const -> iterator { return out_; } diff --git a/include/quill/bundled/fmt/chrono.h b/include/quill/bundled/fmt/chrono.h index 4ad99f87..397a968d 100644 --- a/include/quill/bundled/fmt/chrono.h +++ b/include/quill/bundled/fmt/chrono.h @@ -22,7 +22,7 @@ #include "format.h" -namespace fmt_detail { +namespace fmtquill_detail { struct time_zone { template auto to_sys(T) @@ -35,7 +35,7 @@ template inline auto current_zone(T...) -> time_zone* { } template inline void _tzset(T...) {} -} // namespace fmt_detail +} // namespace fmtquill_detail FMTQUILL_BEGIN_NAMESPACE @@ -523,8 +523,8 @@ auto to_time_t(sys_time time_point) -> std::time_t { // providing current_zone(): https://github.com/fmtlib/fmt/issues/4160. template FMTQUILL_CONSTEXPR auto has_current_zone() -> bool { using namespace std::chrono; - using namespace fmt_detail; - return !std::is_same::value; + using namespace fmtquill_detail; + return !std::is_same::value; } } // namespace detail @@ -576,7 +576,7 @@ template ())> inline auto localtime(std::chrono::local_time time) -> std::tm { using namespace std::chrono; - using namespace fmt_detail; + using namespace fmtquill_detail; return localtime(detail::to_time_t(current_zone()->to_sys(time))); } #endif @@ -992,7 +992,7 @@ struct has_member_data_tm_zone> inline void tzset_once() { static bool init = []() { - using namespace fmt_detail; + using namespace fmtquill_detail; _tzset(); return false; }(); diff --git a/include/quill/bundled/fmt/format.h b/include/quill/bundled/fmt/format.h index b23a73ed..4379433e 100644 --- a/include/quill/bundled/fmt/format.h +++ b/include/quill/bundled/fmt/format.h @@ -227,7 +227,9 @@ FMTQUILL_CONSTEXPR inline void abort_fuzzing_if(bool condition) { #if defined(FMTQUILL_USE_STRING_VIEW) template using std_string_view = std::basic_string_view; #else -template struct std_string_view {}; +template struct std_string_view { + operator basic_string_view() const; +}; #endif template struct string_literal { @@ -1210,7 +1212,7 @@ FMTQUILL_CONSTEXPR FMTQUILL_INLINE auto format_decimal(Char* out, UInt value, } template ::value)> + FMTQUILL_ENABLE_IF(!std::is_pointer>::value)> FMTQUILL_CONSTEXPR auto format_decimal(OutputIt out, UInt value, int num_digits) -> OutputIt { if (auto ptr = to_pointer(out, to_unsigned(num_digits))) { diff --git a/include/quill/bundled/fmt/ostream.h b/include/quill/bundled/fmt/ostream.h index 4575d999..18293d15 100644 --- a/include/quill/bundled/fmt/ostream.h +++ b/include/quill/bundled/fmt/ostream.h @@ -150,7 +150,7 @@ inline void vprint(std::ostream& os, string_view fmt, format_args args) { FMTQUILL_EXPORT template void print(std::ostream& os, format_string fmt, T&&... args) { fmtquill::vargs vargs = {{args...}}; - if (detail::use_utf8) return vprint(os, fmt.str, vargs); + if (detail::const_check(detail::use_utf8)) return vprint(os, fmt.str, vargs); auto buffer = memory_buffer(); detail::vformat_to(buffer, fmt.str, vargs); detail::write_buffer(os, buffer); diff --git a/include/quill/bundled/fmt/ranges.h b/include/quill/bundled/fmt/ranges.h index ba8f048d..d5ade2b2 100644 --- a/include/quill/bundled/fmt/ranges.h +++ b/include/quill/bundled/fmt/ranges.h @@ -527,7 +527,9 @@ struct formatter< template struct formatter< R, Char, - enable_if_t::value == range_format::map>> { + enable_if_t::value == range_format::map>, + detail::is_formattable_delayed>::value>> { private: using map_type = detail::maybe_const_range; using element_type = detail::uncvref_type; diff --git a/scripts/rename_libfmt.py b/scripts/rename_libfmt.py index 96d02f74..cd00b9bc 100644 --- a/scripts/rename_libfmt.py +++ b/scripts/rename_libfmt.py @@ -25,10 +25,14 @@ def rename(file_path, macro_replace, namespace_replace): # Use regular expressions to find and replace macros and namespace macro_pattern = r'\bFMT_' namespace_pattern = r'namespace\s+fmt\b' + fmt_namespace_detail_pattern = r'namespace\s+fmt_detail\b' + fmt_detail_pattern = r'\bfmt_detail::' updated_content = re.sub(macro_pattern, macro_replace + '_', content) updated_content = re.sub(r'fmt::', f'{namespace_replace}::', updated_content) updated_content = re.sub(namespace_pattern, f'namespace {namespace_replace}', updated_content) + updated_content = re.sub(fmt_namespace_detail_pattern, f'namespace {namespace_replace}_detail', updated_content) + updated_content = re.sub(fmt_detail_pattern, f'{namespace_replace}_detail::', updated_content) # Write the updated content back to the source file with open(file_path, 'w') as file: