annotate dep/fmt/src/fmt.cc @ 337:a7d4e5107531

dep/animone: REFACTOR ALL THE THINGS 1: animone now has its own syntax divergent from anisthesia, making different platforms actually have their own sections 2: process names in animone are now called `comm' (this will probably break things). this is what its called in bsd/linux so I'm just going to use it everywhere 3: the X11 code now checks for the existence of a UTF-8 window title and passes it if available 4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK! I still actually need to test the bsd code. to be honest I'm probably going to move all of the bsds into separate files because they're all essentially different operating systems at this point
author Paper <paper@paper.us.eu.org>
date Wed, 19 Jun 2024 12:51:15 -0400
parents 4aeffed717ef
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
329
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
1 module;
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
2
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
3 // Put all implementation-provided headers into the global module fragment
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
4 // to prevent attachment to this module.
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
5 #include <algorithm>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
6 #include <cerrno>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
7 #include <chrono>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
8 #include <climits>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
9 #include <cmath>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
10 #include <cstddef>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
11 #include <cstdint>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
12 #include <cstdio>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
13 #include <cstdlib>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
14 #include <cstring>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
15 #include <ctime>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
16 #include <exception>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
17 #include <filesystem>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
18 #include <fstream>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
19 #include <functional>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
20 #include <iterator>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
21 #include <limits>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
22 #include <locale>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
23 #include <memory>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
24 #include <optional>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
25 #include <ostream>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
26 #include <stdexcept>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
27 #include <string>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
28 #include <string_view>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
29 #include <system_error>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
30 #include <thread>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
31 #include <type_traits>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
32 #include <typeinfo>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
33 #include <utility>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
34 #include <variant>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
35 #include <vector>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
36 #include <version>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
37
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
38 #if __has_include(<cxxabi.h>)
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
39 # include <cxxabi.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
40 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
41 #if defined(_MSC_VER) || defined(__MINGW32__)
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
42 # include <intrin.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
43 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
44 #if defined __APPLE__ || defined(__FreeBSD__)
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
45 # include <xlocale.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
46 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
47 #if __has_include(<winapifamily.h>)
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
48 # include <winapifamily.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
49 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
50 #if (__has_include(<fcntl.h>) || defined(__APPLE__) || \
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
51 defined(__linux__)) && \
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
52 (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
53 # include <fcntl.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
54 # include <sys/stat.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
55 # include <sys/types.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
56 # ifndef _WIN32
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
57 # include <unistd.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
58 # else
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
59 # include <io.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
60 # endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
61 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
62 #ifdef _WIN32
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
63 # if defined(__GLIBCXX__)
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
64 # include <ext/stdio_filebuf.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
65 # include <ext/stdio_sync_filebuf.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
66 # endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
67 # define WIN32_LEAN_AND_MEAN
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
68 # include <windows.h>
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
69 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
70
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
71 export module fmt;
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
72
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
73 #define FMT_EXPORT export
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
74 #define FMT_BEGIN_EXPORT export {
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
75 #define FMT_END_EXPORT }
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
76
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
77 // If you define FMT_ATTACH_TO_GLOBAL_MODULE
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
78 // - all declarations are detached from module 'fmt'
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
79 // - the module behaves like a traditional static library, too
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
80 // - all library symbols are mangled traditionally
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
81 // - you can mix TUs with either importing or #including the {fmt} API
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
82 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
83 extern "C++" {
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
84 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
85
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
86 // All library-provided declarations and definitions must be in the module
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
87 // purview to be exported.
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
88 #include "fmt/args.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
89 #include "fmt/chrono.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
90 #include "fmt/color.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
91 #include "fmt/compile.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
92 #include "fmt/format.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
93 #include "fmt/os.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
94 #include "fmt/printf.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
95 #include "fmt/std.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
96 #include "fmt/xchar.h"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
97
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
98 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
99 }
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
100 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
101
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
102 // gcc doesn't yet implement private module fragments
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
103 #if !FMT_GCC_VERSION
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
104 module :private;
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
105 #endif
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
106
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
107 #include "format.cc"
4aeffed717ef dep/fmt: add dependency
Paper <paper@paper.us.eu.org>
parents:
diff changeset
108 #include "os.cc"