git repos / blockattack-game

blame: source/misc/embedded_libs/fmt-11.0.2/src/fmt.cc

normal view · raw

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