aboutsummaryrefslogtreecommitdiff
path: root/dep/fmt/src/fmt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dep/fmt/src/fmt.cc')
-rw-r--r--dep/fmt/src/fmt.cc111
1 files changed, 79 insertions, 32 deletions
diff --git a/dep/fmt/src/fmt.cc b/dep/fmt/src/fmt.cc
index 5330463a932..0713da75c39 100644
--- a/dep/fmt/src/fmt.cc
+++ b/dep/fmt/src/fmt.cc
@@ -1,38 +1,61 @@
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.
-#include <algorithm>
+#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 <chrono>
#include <climits>
-#include <cmath>
-#include <cstddef>
-#include <cstdint>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-#include <exception>
-#include <filesystem>
-#include <fstream>
-#include <functional>
-#include <iterator>
-#include <limits>
-#include <locale>
-#include <memory>
-#include <optional>
-#include <ostream>
-#include <stdexcept>
-#include <string>
-#include <string_view>
-#include <system_error>
-#include <thread>
-#include <type_traits>
-#include <typeinfo>
-#include <utility>
-#include <variant>
-#include <vector>
#include <version>
#if __has_include(<cxxabi.h>)
@@ -70,6 +93,10 @@ module;
export module fmt;
+#ifdef FMT_IMPORT_STD
+import std;
+#endif
+
#define FMT_EXPORT export
#define FMT_BEGIN_EXPORT export {
#define FMT_END_EXPORT }
@@ -83,6 +110,10 @@ export module fmt;
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"
@@ -90,8 +121,12 @@ extern "C++" {
#include "fmt/color.h"
#include "fmt/compile.h"
#include "fmt/format.h"
-#include "fmt/os.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"
@@ -104,5 +139,17 @@ extern "C++" {
module :private;
#endif
-#include "format.cc"
-#include "os.cc"
+#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