From a6236aa56e6302d6c0c180a49380cb54f161a7c3 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 29 Jan 2025 12:20:02 +0100 Subject: [PATCH] Move to for clarity --- include/lol/private/math/matrix.ipp | 4 ++-- include/lol/private/math/transform.ipp | 4 ++-- include/lol/private/math/vector.ipp | 4 ++-- include/lol/{ => std}/format | 14 +++++++++----- 4 files changed, 15 insertions(+), 11 deletions(-) rename include/lol/{ => std}/format (69%) diff --git a/include/lol/private/math/matrix.ipp b/include/lol/private/math/matrix.ipp index d4a2d158..18b0fabe 100644 --- a/include/lol/private/math/matrix.ipp +++ b/include/lol/private/math/matrix.ipp @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010–2024 Sam Hocevar +// Copyright © 2010–2025 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -15,7 +15,7 @@ #include #include // std::tan #include // std::max -#include // std::format +#include // std::format namespace lol { diff --git a/include/lol/private/math/transform.ipp b/include/lol/private/math/transform.ipp index 5c59f509..824f82d1 100644 --- a/include/lol/private/math/transform.ipp +++ b/include/lol/private/math/transform.ipp @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010–2024 Sam Hocevar +// Copyright © 2010–2025 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -13,7 +13,7 @@ #pragma once #include // std::cos, std::sin -#include // std::format +#include // std::format namespace lol { diff --git a/include/lol/private/math/vector.ipp b/include/lol/private/math/vector.ipp index 059c47c6..4d0c73c8 100644 --- a/include/lol/private/math/vector.ipp +++ b/include/lol/private/math/vector.ipp @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010–2024 Sam Hocevar +// Copyright © 2010–2025 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -12,7 +12,7 @@ #pragma once -#include // std::format +#include // std::format namespace lol { diff --git a/include/lol/format b/include/lol/std/format similarity index 69% rename from include/lol/format rename to include/lol/std/format index e12308fe..56195983 100644 --- a/include/lol/format +++ b/include/lol/std/format @@ -1,7 +1,7 @@ // // Lol Engine // -// Copyright © 2010–2024 Sam Hocevar +// Copyright © 2010–2025 Sam Hocevar // // Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it @@ -12,6 +12,7 @@ #pragma once +// Assume std::format is available, then check for exceptions #define LOL_HAS_STD_FORMAT 1 #if !defined __SCE__ @@ -21,20 +22,23 @@ # endif #endif -#if defined __SCE__ -# undef LOL_HAS_STD_FORMAT -# include +#if defined __SCE__ // SCE platforms do not have , so check for C++20 support +# if !_HAS_CXX20 +# undef LOL_HAS_STD_FORMAT +# include // These functions are used unconditionally in libfmt static inline void flockfile(FILE* f) { } static inline void funlockfile(FILE* f) { } static inline int getc_unlocked(FILE*) { return 0; } static inline int putc_unlocked(int, FILE*) { return 0; } +# endif #endif +// Include if everything went well, otherwise use the 3rd party implementation #if defined LOL_HAS_STD_FORMAT # include #else # define FMT_HEADER_ONLY -# include "3rdparty/fmt/include/fmt/format.h" +# include "../3rdparty/fmt/include/fmt/format.h" namespace std { using fmt::format; } #endif