diff --git a/common/bspfile.cc b/common/bspfile.cc index 85f9cb4d..1d05deef 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/common/decompile.cc b/common/decompile.cc index 67ee2faa..5755b3d6 100644 --- a/common/decompile.cc +++ b/common/decompile.cc @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include "tbb/parallel_for.h" diff --git a/common/qvec.cc b/common/qvec.cc index 8c82fa3d..f1b4cd4a 100644 --- a/common/qvec.cc +++ b/common/qvec.cc @@ -20,7 +20,7 @@ #include #include // for NAN -#include +#include /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) diff --git a/include/common/bspfile_generic.hh b/include/common/bspfile_generic.hh index 9f6573ea..0aa6fd51 100644 --- a/include/common/bspfile_generic.hh +++ b/include/common/bspfile_generic.hh @@ -19,7 +19,7 @@ #pragma once -#include +#include #include #include @@ -271,7 +271,9 @@ enum class plane_type_t }; // Fmt support -template <> struct fmt::formatter : formatter { +template <> struct fmt::formatter { + constexpr auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) { return ctx.end(); } + template auto format(plane_type_t t, FormatContext& ctx) { string_view name = "unknown"; @@ -284,7 +286,7 @@ template <> struct fmt::formatter : formatter { case plane_type_t::PLANE_ANYY: name = "PLANE_ANYY"; break; case plane_type_t::PLANE_ANYZ: name = "PLANE_ANYZ"; break; } - return formatter::format(name, ctx); + return format_to(ctx.out(), "{}", name); } }; diff --git a/include/common/fs.hh b/include/common/fs.hh index 66864dd9..6af86af6 100644 --- a/include/common/fs.hh +++ b/include/common/fs.hh @@ -131,15 +131,17 @@ inline fs::path DefaultExtension(const fs::path &path, const fs::path &extension return fs::path(path).replace_extension(extension); } -#include +#include // TODO: no wchar_t support in this version apparently template<> -struct fmt::formatter : formatter +struct fmt::formatter { + constexpr auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) { return ctx.end(); } + template auto format(const fs::path &p, FormatContext &ctx) { - return formatter::format(p.string(), ctx); + return format_to(ctx.out(), "{}", p.string()); } }; \ No newline at end of file diff --git a/include/common/log.hh b/include/common/log.hh index ae8c7ceb..cf0fd6d7 100644 --- a/include/common/log.hh +++ b/include/common/log.hh @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/common/qvec.hh b/include/common/qvec.hh index e34e91d4..9fca37c7 100644 --- a/include/common/qvec.hh +++ b/include/common/qvec.hh @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "common/mathlib.hh" #include "common/cmdlib.hh" @@ -340,17 +340,19 @@ public: // Fmt support template -struct fmt::formatter> : formatter +struct fmt::formatter> { + constexpr auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) { return ctx.end(); } + template auto format(const qvec &p, FormatContext &ctx) -> decltype(ctx.out()) { for (size_t i = 0; i < N - 1; i++) { - formatter::format(p[i], ctx); + format_to(ctx.out(), "{}", p[i]); format_to(ctx.out(), " "); } - return formatter::format(p[N - 1], ctx); + return format_to(ctx.out(), "{}", p[N - 1]); } }; diff --git a/lightpreview/glview.cpp b/lightpreview/glview.cpp index 529491ee..c583bbe8 100644 --- a/lightpreview/glview.cpp +++ b/lightpreview/glview.cpp @@ -26,7 +26,7 @@ See file, 'COPYING', for details. #include #include #include -#include +#include GLView::GLView(QWidget *parent) : QOpenGLWidget(parent), m_keysPressed(0), m_keymoveUpdateTimer(0), m_lastMouseDownPos(0, 0), m_displayAspect(1), diff --git a/tests/test_light.cc b/tests/test_light.cc index 8e85d89e..f8f48f33 100644 --- a/tests/test_light.cc +++ b/tests/test_light.cc @@ -5,7 +5,6 @@ #include #include // for std::sort -#include #include