Mercurial > minori
comparison dep/fmt/src/fmt.cc @ 329:4aeffed717ef
dep/fmt: add dependency
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 17 Jun 2024 04:54:44 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
328:71396ecb6f7e | 329:4aeffed717ef |
---|---|
1 module; | |
2 | |
3 // Put all implementation-provided headers into the global module fragment | |
4 // to prevent attachment to this module. | |
5 #include <algorithm> | |
6 #include <cerrno> | |
7 #include <chrono> | |
8 #include <climits> | |
9 #include <cmath> | |
10 #include <cstddef> | |
11 #include <cstdint> | |
12 #include <cstdio> | |
13 #include <cstdlib> | |
14 #include <cstring> | |
15 #include <ctime> | |
16 #include <exception> | |
17 #include <filesystem> | |
18 #include <fstream> | |
19 #include <functional> | |
20 #include <iterator> | |
21 #include <limits> | |
22 #include <locale> | |
23 #include <memory> | |
24 #include <optional> | |
25 #include <ostream> | |
26 #include <stdexcept> | |
27 #include <string> | |
28 #include <string_view> | |
29 #include <system_error> | |
30 #include <thread> | |
31 #include <type_traits> | |
32 #include <typeinfo> | |
33 #include <utility> | |
34 #include <variant> | |
35 #include <vector> | |
36 #include <version> | |
37 | |
38 #if __has_include(<cxxabi.h>) | |
39 # include <cxxabi.h> | |
40 #endif | |
41 #if defined(_MSC_VER) || defined(__MINGW32__) | |
42 # include <intrin.h> | |
43 #endif | |
44 #if defined __APPLE__ || defined(__FreeBSD__) | |
45 # include <xlocale.h> | |
46 #endif | |
47 #if __has_include(<winapifamily.h>) | |
48 # include <winapifamily.h> | |
49 #endif | |
50 #if (__has_include(<fcntl.h>) || defined(__APPLE__) || \ | |
51 defined(__linux__)) && \ | |
52 (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) | |
53 # include <fcntl.h> | |
54 # include <sys/stat.h> | |
55 # include <sys/types.h> | |
56 # ifndef _WIN32 | |
57 # include <unistd.h> | |
58 # else | |
59 # include <io.h> | |
60 # endif | |
61 #endif | |
62 #ifdef _WIN32 | |
63 # if defined(__GLIBCXX__) | |
64 # include <ext/stdio_filebuf.h> | |
65 # include <ext/stdio_sync_filebuf.h> | |
66 # endif | |
67 # define WIN32_LEAN_AND_MEAN | |
68 # include <windows.h> | |
69 #endif | |
70 | |
71 export module fmt; | |
72 | |
73 #define FMT_EXPORT export | |
74 #define FMT_BEGIN_EXPORT export { | |
75 #define FMT_END_EXPORT } | |
76 | |
77 // If you define FMT_ATTACH_TO_GLOBAL_MODULE | |
78 // - all declarations are detached from module 'fmt' | |
79 // - the module behaves like a traditional static library, too | |
80 // - all library symbols are mangled traditionally | |
81 // - you can mix TUs with either importing or #including the {fmt} API | |
82 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE | |
83 extern "C++" { | |
84 #endif | |
85 | |
86 // All library-provided declarations and definitions must be in the module | |
87 // purview to be exported. | |
88 #include "fmt/args.h" | |
89 #include "fmt/chrono.h" | |
90 #include "fmt/color.h" | |
91 #include "fmt/compile.h" | |
92 #include "fmt/format.h" | |
93 #include "fmt/os.h" | |
94 #include "fmt/printf.h" | |
95 #include "fmt/std.h" | |
96 #include "fmt/xchar.h" | |
97 | |
98 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE | |
99 } | |
100 #endif | |
101 | |
102 // gcc doesn't yet implement private module fragments | |
103 #if !FMT_GCC_VERSION | |
104 module :private; | |
105 #endif | |
106 | |
107 #include "format.cc" | |
108 #include "os.cc" |