duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

fmt.cc (2568B)


      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 #  elif defined(_LIBCPP_VERSION)
     67 #    include <__std_stream>
     68 #  endif
     69 #  define WIN32_LEAN_AND_MEAN
     70 #  include <windows.h>
     71 #endif
     72 
     73 export module fmt;
     74 
     75 #define FMT_EXPORT export
     76 #define FMT_BEGIN_EXPORT export {
     77 #define FMT_END_EXPORT }
     78 
     79 // If you define FMT_ATTACH_TO_GLOBAL_MODULE
     80 //  - all declarations are detached from module 'fmt'
     81 //  - the module behaves like a traditional static library, too
     82 //  - all library symbols are mangled traditionally
     83 //  - you can mix TUs with either importing or #including the {fmt} API
     84 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE
     85 extern "C++" {
     86 #endif
     87 
     88 // All library-provided declarations and definitions must be in the module
     89 // purview to be exported.
     90 #include "fmt/args.h"
     91 #include "fmt/chrono.h"
     92 #include "fmt/color.h"
     93 #include "fmt/compile.h"
     94 #include "fmt/format.h"
     95 #include "fmt/os.h"
     96 #include "fmt/printf.h"
     97 #include "fmt/std.h"
     98 #include "fmt/xchar.h"
     99 
    100 #ifdef FMT_ATTACH_TO_GLOBAL_MODULE
    101 }
    102 #endif
    103 
    104 // gcc doesn't yet implement private module fragments
    105 #if !FMT_GCC_VERSION
    106 module : private;
    107 #endif
    108 
    109 #include "format.cc"
    110 #include "os.cc"