Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/dep/fmt/src/fmt.cc
4246 views
1
module;
2
3
#define FMT_MODULE
4
5
#ifdef _MSVC_LANG
6
# define FMT_CPLUSPLUS _MSVC_LANG
7
#else
8
# define FMT_CPLUSPLUS __cplusplus
9
#endif
10
11
// Put all implementation-provided headers into the global module fragment
12
// to prevent attachment to this module.
13
#ifndef FMT_IMPORT_STD
14
# include <algorithm>
15
# include <bitset>
16
# include <chrono>
17
# include <cmath>
18
# include <complex>
19
# include <cstddef>
20
# include <cstdint>
21
# include <cstdio>
22
# include <cstdlib>
23
# include <cstring>
24
# include <ctime>
25
# include <exception>
26
# if FMT_CPLUSPLUS > 202002L
27
# include <expected>
28
# endif
29
# include <filesystem>
30
# include <fstream>
31
# include <functional>
32
# include <iterator>
33
# include <limits>
34
# include <locale>
35
# include <memory>
36
# include <optional>
37
# include <ostream>
38
# include <source_location>
39
# include <stdexcept>
40
# include <string>
41
# include <string_view>
42
# include <system_error>
43
# include <thread>
44
# include <type_traits>
45
# include <typeinfo>
46
# include <utility>
47
# include <variant>
48
# include <vector>
49
#else
50
# include <limits.h>
51
# include <stdint.h>
52
# include <stdio.h>
53
# include <time.h>
54
#endif
55
#include <cerrno>
56
#include <climits>
57
#include <version>
58
59
#if __has_include(<cxxabi.h>)
60
# include <cxxabi.h>
61
#endif
62
#if defined(_MSC_VER) || defined(__MINGW32__)
63
# include <intrin.h>
64
#endif
65
#if defined __APPLE__ || defined(__FreeBSD__)
66
# include <xlocale.h>
67
#endif
68
#if __has_include(<winapifamily.h>)
69
# include <winapifamily.h>
70
#endif
71
#if (__has_include(<fcntl.h>) || defined(__APPLE__) || \
72
defined(__linux__)) && \
73
(!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
74
# include <fcntl.h>
75
# include <sys/stat.h>
76
# include <sys/types.h>
77
# ifndef _WIN32
78
# include <unistd.h>
79
# else
80
# include <io.h>
81
# endif
82
#endif
83
#ifdef _WIN32
84
# if defined(__GLIBCXX__)
85
# include <ext/stdio_filebuf.h>
86
# include <ext/stdio_sync_filebuf.h>
87
# endif
88
# define WIN32_LEAN_AND_MEAN
89
# include <windows.h>
90
#endif
91
92
export module fmt;
93
94
#ifdef FMT_IMPORT_STD
95
import std;
96
#endif
97
98
#define FMT_EXPORT export
99
#define FMT_BEGIN_EXPORT export {
100
#define FMT_END_EXPORT }
101
102
// If you define FMT_ATTACH_TO_GLOBAL_MODULE
103
// - all declarations are detached from module 'fmt'
104
// - the module behaves like a traditional static library, too
105
// - all library symbols are mangled traditionally
106
// - you can mix TUs with either importing or #including the {fmt} API
107
#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
108
extern "C++" {
109
#endif
110
111
#ifndef FMT_OS
112
# define FMT_OS 1
113
#endif
114
115
// All library-provided declarations and definitions must be in the module
116
// purview to be exported.
117
#include "fmt/args.h"
118
#include "fmt/chrono.h"
119
#include "fmt/color.h"
120
#include "fmt/compile.h"
121
#include "fmt/format.h"
122
#if FMT_OS
123
# include "fmt/os.h"
124
#endif
125
#include "fmt/ostream.h"
126
#include "fmt/printf.h"
127
#include "fmt/ranges.h"
128
#include "fmt/std.h"
129
#include "fmt/xchar.h"
130
131
#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
132
}
133
#endif
134
135
// gcc doesn't yet implement private module fragments
136
#if !FMT_GCC_VERSION
137
module :private;
138
#endif
139
140
#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
141
extern "C++" {
142
#endif
143
144
#if FMT_HAS_INCLUDE("format.cc")
145
# include "format.cc"
146
#endif
147
#if FMT_OS && FMT_HAS_INCLUDE("os.cc")
148
# include "os.cc"
149
#endif
150
151
#ifdef FMT_ATTACH_TO_GLOBAL_MODULE
152
}
153
#endif
154
155