diff --git a/.gitmodules b/.gitmodules index 6cbe89b3..33ae3f1e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,9 @@ branch = lol update = merge upstream = https://github.com/CLIUtils/CLI11 + +[submodule "include/lol/3rdparty/fmt"] + path = include/lol/3rdparty/fmt + url = https://github.com/fmtlib/fmt + branch = master + update = merge diff --git a/README.md b/README.md index f5e61c2c..abf16e83 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ The header-only part of the Lol Engine framework. | `` | command-line parsing (imported from [cliutils/cli11](https://github.com/CLIUtils/CLI11)) | | | `` | portable file dialogs (imported from [samhocevar/portable-file-dialogs](https://github.com/samhocevar/portable-file-dialogs)) | | | `` | file reading utilities | ● `lol::read(filename, data)` for any `std::string` or `std::vector`
● `lol::write(filename, data)` | +| `` | ensure `std::format` is available, using a fallback if necessary | | | `` | simple message logging | ● `lol::msg::info("hello\n");`
● `lol::msg::debug("%d %d\n", x, y);`
● also `lol::msg::error`, `lol::msg::warn` | | `` | threading and timing | ● `lol::thread`
● `lol::queue` (thread-safe FIFO queue)
● `lol::timer` (high precision timer) | | `` | unit test framework | | diff --git a/include/lol/3rdparty/fmt b/include/lol/3rdparty/fmt new file mode 160000 index 00000000..71a4a8d4 --- /dev/null +++ b/include/lol/3rdparty/fmt @@ -0,0 +1 @@ +Subproject commit 71a4a8d47999e95f5e460eaf8cec894f60354a13 diff --git a/include/lol/format b/include/lol/format new file mode 100644 index 00000000..ffe9be8b --- /dev/null +++ b/include/lol/format @@ -0,0 +1,22 @@ +// +// Lol Engine +// +// Copyright © 2010–2024 Sam Hocevar +// +// Lol Engine is free software. It comes without any warranty, to +// the extent permitted by applicable law. You can redistribute it +// and/or modify it under the terms of the Do What the Fuck You Want +// to Public License, Version 2, as published by the WTFPL Task Force. +// See http://www.wtfpl.net/ for more details. +// + +#pragma once + +#include +#if defined _LIBCPP_HAS_NO_INCOMPLETE_FORMAT +# define FMT_HEADER_ONLY +# include "3rdparty/fmt/include/fmt/format.h" + namespace std { using fmt::format; } +#else +# include +#endif diff --git a/include/lol/private/base/string.h b/include/lol/private/base/string.h index 07924eef..0f1e3b29 100644 --- a/include/lol/private/base/string.h +++ b/include/lol/private/base/string.h @@ -21,7 +21,6 @@ #include "../features.h" -#include // std::format #include // std::vector #include // std::basic_string #include // std::transform diff --git a/include/lol/private/math/matrix.ipp b/include/lol/private/math/matrix.ipp index c60dc993..d4a2d158 100644 --- a/include/lol/private/math/matrix.ipp +++ b/include/lol/private/math/matrix.ipp @@ -13,9 +13,9 @@ #pragma once #include -#include // std::tan -#include // std::max -#include // std::format +#include // std::tan +#include // std::max +#include // std::format namespace lol { diff --git a/include/lol/private/math/transform.ipp b/include/lol/private/math/transform.ipp index 3e0fe862..5c59f509 100644 --- a/include/lol/private/math/transform.ipp +++ b/include/lol/private/math/transform.ipp @@ -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 0644d420..059c47c6 100644 --- a/include/lol/private/math/vector.ipp +++ b/include/lol/private/math/vector.ipp @@ -12,7 +12,7 @@ #pragma once -#include // std::format +#include // std::format namespace lol {