Skip to content

Commit

Permalink
[upstream_utils] Upgrade to fmt 11.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jan 3, 2025
1 parent 9ebc4b3 commit c885804
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion upstream_utils/fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def copy_upstream_src(wpilib_root):
def main():
name = "fmt"
url = "https://github.com/fmtlib/fmt"
tag = "11.1.0"
tag = "11.1.1"

fmt = Lib(name, url, tag, copy_upstream_src)
fmt.main()
Expand Down
26 changes: 21 additions & 5 deletions wpiutil/src/main/native/thirdparty/fmtlib/include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif

// The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 110100
#define FMT_VERSION 110101

// Detect compiler versions.
#if defined(__clang__) && !defined(__ibmxl__)
Expand Down Expand Up @@ -161,6 +161,20 @@
# define FMT_CATCH(x) if (false)
#endif

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

#if FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
# define FMT_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__)
Expand Down Expand Up @@ -2604,10 +2618,11 @@ template <typename Context> class basic_format_args {
};

// A formatting context.
class context : private detail::locale_ref {
class context {
private:
appender out_;
format_args args_;
FMT_NO_UNIQUE_ADDRESS detail::locale_ref loc_;

public:
/// The character type for the output.
Expand All @@ -2623,7 +2638,7 @@ class context : private detail::locale_ref {
/// in the object so make sure they have appropriate lifetimes.
FMT_CONSTEXPR context(iterator out, format_args args,
detail::locale_ref loc = {})
: locale_ref(loc), out_(out), args_(args) {}
: out_(out), args_(args), loc_(loc) {}
context(context&&) = default;
context(const context&) = delete;
void operator=(const context&) = delete;
Expand All @@ -2642,7 +2657,7 @@ class context : private detail::locale_ref {
// Advances the begin iterator to `it`.
FMT_CONSTEXPR void advance_to(iterator) {}

FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return *this; }
FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return loc_; }
};

template <typename Char = char> struct runtime_format_string {
Expand All @@ -2659,7 +2674,8 @@ template <typename Char = char> struct runtime_format_string {
*/
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }

/// A compile-time format string.
/// A compile-time format string. Use `format_string` in the public API to
/// prevent type deduction.
template <typename... T> struct fstring {
private:
static constexpr int num_static_named_args =
Expand Down
14 changes: 0 additions & 14 deletions wpiutil/src/main/native/thirdparty/fmtlib/include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ FMT_END_NAMESPACE
# endif // FMT_USE_EXCEPTIONS
#endif // FMT_THROW

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
// integer formatter template instantiations to just one by only using the
// largest integer type. This results in a reduction in binary size but will
Expand Down

0 comments on commit c885804

Please sign in to comment.