aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/fmt/src/fmt.cc
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-11-07 14:49:13 +0100
committerGitHub Enterprise <[email protected]>2025-11-07 14:49:13 +0100
commit24e43a913f29ac3b314354e8ce5175f135bcc64f (patch)
treeca442937ceeb63461012b33a4576e9835099f106 /thirdparty/fmt/src/fmt.cc
parentget oplog attachments (#622) (diff)
downloadzen-24e43a913f29ac3b314354e8ce5175f135bcc64f.tar.xz
zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.zip
switch to xmake for package management (#611)
This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder. It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build. * Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist * BLAKE3 is now in-tree at `thirdparty/blake3` * cpr is now in-tree at `thirdparty/cpr` * cxxopts is now in-tree at `thirdparty/cxxopts` * fmt is now in-tree at `thirdparty/fmt` * robin-map is now in-tree at `thirdparty/robin-map` * ryml is now in-tree at `thirdparty/ryml` * sol2 is now in-tree at `thirdparty/sol2` * spdlog is now in-tree at `thirdparty/spdlog` * utfcpp is now in-tree at `thirdparty/utfcpp` * xmake package repo definitions is in `repo` * implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS * the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux * crashpad * bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug
Diffstat (limited to 'thirdparty/fmt/src/fmt.cc')
-rw-r--r--thirdparty/fmt/src/fmt.cc155
1 files changed, 155 insertions, 0 deletions
diff --git a/thirdparty/fmt/src/fmt.cc b/thirdparty/fmt/src/fmt.cc
new file mode 100644
index 000000000..0713da75c
--- /dev/null
+++ b/thirdparty/fmt/src/fmt.cc
@@ -0,0 +1,155 @@
+module;
+
+#define FMT_MODULE
+
+#ifdef _MSVC_LANG
+# define FMT_CPLUSPLUS _MSVC_LANG
+#else
+# define FMT_CPLUSPLUS __cplusplus
+#endif
+
+// Put all implementation-provided headers into the global module fragment
+// to prevent attachment to this module.
+#ifndef FMT_IMPORT_STD
+# include <algorithm>
+# include <bitset>
+# include <chrono>
+# include <cmath>
+# include <complex>
+# include <cstddef>
+# include <cstdint>
+# include <cstdio>
+# include <cstdlib>
+# include <cstring>
+# include <ctime>
+# include <exception>
+# if FMT_CPLUSPLUS > 202002L
+# include <expected>
+# endif
+# include <filesystem>
+# include <fstream>
+# include <functional>
+# include <iterator>
+# include <limits>
+# include <locale>
+# include <memory>
+# include <optional>
+# include <ostream>
+# include <source_location>
+# include <stdexcept>
+# include <string>
+# include <string_view>
+# include <system_error>
+# include <thread>
+# include <type_traits>
+# include <typeinfo>
+# include <utility>
+# include <variant>
+# include <vector>
+#else
+# include <limits.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <time.h>
+#endif
+#include <cerrno>
+#include <climits>
+#include <version>
+
+#if __has_include(<cxxabi.h>)
+# include <cxxabi.h>
+#endif
+#if defined(_MSC_VER) || defined(__MINGW32__)
+# include <intrin.h>
+#endif
+#if defined __APPLE__ || defined(__FreeBSD__)
+# include <xlocale.h>
+#endif
+#if __has_include(<winapifamily.h>)
+# include <winapifamily.h>
+#endif
+#if (__has_include(<fcntl.h>) || defined(__APPLE__) || \
+ defined(__linux__)) && \
+ (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
+# include <fcntl.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+# ifndef _WIN32
+# include <unistd.h>
+# else
+# include <io.h>
+# endif
+#endif
+#ifdef _WIN32
+# if defined(__GLIBCXX__)
+# include <ext/stdio_filebuf.h>
+# include <ext/stdio_sync_filebuf.h>
+# endif
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+export module fmt;
+
+#ifdef FMT_IMPORT_STD
+import std;
+#endif
+
+#define FMT_EXPORT export
+#define FMT_BEGIN_EXPORT export {
+#define FMT_END_EXPORT }
+
+// If you define FMT_ATTACH_TO_GLOBAL_MODULE
+// - all declarations are detached from module 'fmt'
+// - the module behaves like a traditional static library, too
+// - all library symbols are mangled traditionally
+// - you can mix TUs with either importing or #including the {fmt} API
+#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
+extern "C++" {
+#endif
+
+#ifndef FMT_OS
+# define FMT_OS 1
+#endif
+
+// All library-provided declarations and definitions must be in the module
+// purview to be exported.
+#include "fmt/args.h"
+#include "fmt/chrono.h"
+#include "fmt/color.h"
+#include "fmt/compile.h"
+#include "fmt/format.h"
+#if FMT_OS
+# include "fmt/os.h"
+#endif
+#include "fmt/ostream.h"
+#include "fmt/printf.h"
+#include "fmt/ranges.h"
+#include "fmt/std.h"
+#include "fmt/xchar.h"
+
+#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
+}
+#endif
+
+// gcc doesn't yet implement private module fragments
+#if !FMT_GCC_VERSION
+module :private;
+#endif
+
+#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
+extern "C++" {
+#endif
+
+#if FMT_HAS_INCLUDE("format.cc")
+# include "format.cc"
+#endif
+#if FMT_OS && FMT_HAS_INCLUDE("os.cc")
+# include "os.cc"
+#endif
+
+#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
+}
+#endif