Skip to content

Commit

Permalink
Fix compilation with fmt 11
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Jul 3, 2024
1 parent d3d9eeb commit b31b760
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/NZSL/Lang/Errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,61 @@
#include <utility>

// https://fmt.dev/latest/api.html#udt
template <>
template<>
struct fmt::formatter<nzsl::Ast::AttributeType> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::Ast::AttributeType& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::Ast::AttributeType& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(nzsl::Parser::ToString(p), ctx);
}
};

template <>
template<>
struct fmt::formatter<nzsl::Ast::BuiltinEntry> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::Ast::BuiltinEntry& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::Ast::BuiltinEntry& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(nzsl::Parser::ToString(p), ctx);
}
};

template <>
template<>
struct fmt::formatter<nzsl::Ast::ModuleFeature> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::Ast::ModuleFeature& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::Ast::ModuleFeature& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(nzsl::Parser::ToString(p), ctx);
}
};

template <>
template<>
struct fmt::formatter<nzsl::ErrorCategory> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::ErrorCategory& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::ErrorCategory& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(ToString(p), ctx);
}
};

template <>
template<>
struct fmt::formatter<nzsl::ErrorType> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::ErrorType& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::ErrorType& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(ToString(p), ctx);
}
};

template <>
template<>
struct fmt::formatter<nzsl::ShaderStageType> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::ShaderStageType& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::ShaderStageType& p, FormatContext& ctx) const -> decltype(ctx.out())
{
// Use complete name instead of identifier ("fragment" instead of "frag")
auto it = nzsl::LangData::s_entryPoints.find(p);
Expand All @@ -74,11 +74,11 @@ struct fmt::formatter<nzsl::ShaderStageType> : formatter<string_view>
}
};

template <>
template<>
struct fmt::formatter<nzsl::TokenType> : formatter<string_view>
{
template <typename FormatContext>
auto format(const nzsl::TokenType& p, FormatContext& ctx) -> decltype(ctx.out())
template<typename FormatContext>
auto format(const nzsl::TokenType& p, FormatContext& ctx) const -> decltype(ctx.out())
{
return formatter<string_view>::format(ToString(p), ctx);
}
Expand Down

0 comments on commit b31b760

Please sign in to comment.