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.cc69
1 files changed, 39 insertions, 30 deletions
diff --git a/dep/fmt/src/fmt.cc b/dep/fmt/src/fmt.cc
index 80e77e26af8..5330463a932 100644
--- a/dep/fmt/src/fmt.cc
+++ b/dep/fmt/src/fmt.cc
@@ -1,49 +1,44 @@
module;
-#ifndef __cpp_modules
-# error Module not supported.
-#endif
-
-// put all implementation-provided headers into the global module fragment
-// to prevent attachment to this module
-#if !defined(_CRT_SECURE_NO_WARNINGS) && defined(_MSC_VER)
-# define _CRT_SECURE_NO_WARNINGS
-#endif
-#if !defined(WIN32_LEAN_AND_MEAN) && defined(_WIN32)
-# define WIN32_LEAN_AND_MEAN
-#endif
+// Put all implementation-provided headers into the global module fragment
+// to prevent attachment to this module.
#include <algorithm>
-#include <cctype>
#include <cerrno>
#include <chrono>
#include <climits>
-#include <clocale>
#include <cmath>
-#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
-#include <cwchar>
#include <exception>
+#include <filesystem>
+#include <fstream>
#include <functional>
#include <iterator>
#include <limits>
#include <locale>
#include <memory>
+#include <optional>
#include <ostream>
-#include <sstream>
#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 _MSC_VER
+#if __has_include(<cxxabi.h>)
+# include <cxxabi.h>
+#endif
+#if defined(_MSC_VER) || defined(__MINGW32__)
# include <intrin.h>
#endif
#if defined __APPLE__ || defined(__FreeBSD__)
@@ -65,22 +60,31 @@ module;
# 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;
-#define FMT_MODULE_EXPORT export
-#define FMT_MODULE_EXPORT_BEGIN export {
-#define FMT_MODULE_EXPORT_END }
-#define FMT_BEGIN_DETAIL_NAMESPACE \
- } \
- namespace detail {
-#define FMT_END_DETAIL_NAMESPACE \
- } \
- export {
-// all library-provided declarations and definitions
-// must be in the module purview to be exported
+#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
+
+// 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"
@@ -88,11 +92,16 @@ export module fmt;
#include "fmt/format.h"
#include "fmt/os.h"
#include "fmt/printf.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;
+module :private;
#endif
#include "format.cc"