From dacd1356e4f0e787d365b63f612b0e5c5c62c42f Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Sat, 17 Apr 2021 10:38:36 +0200 Subject: [PATCH] Add module interface unit --- src/fmt.cc | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/fmt.cc diff --git a/src/fmt.cc b/src/fmt.cc new file mode 100644 index 00000000..f0dc5721 --- /dev/null +++ b/src/fmt.cc @@ -0,0 +1,87 @@ +module; +// put all implementation-provided headers into the global module fragment +// to prevent attachment to this module +#if !defined(_CRT_SECURE_NO_WARNINGS) && defined(_MSC_VER) +# define _CRT_SECURE_NO_WARNINGS +#endif +#if !defined(WIN32_LEAN_AND_MEAN) && defined(_WIN32) +# define WIN32_LEAN_AND_MEAN +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if _MSC_VER +# include +#endif +#if defined __APPLE__ || defined(__FreeBSD__) +# include +#endif +#if __has_include() +# include +#endif +#if (__has_include() || defined(__APPLE__) || \ + defined(__linux__)) && \ + (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) +# include +# include +# include +# ifndef _WIN32 +# include +# else +# include +# endif +#endif +#ifdef _WIN32 +# include +#endif + +export module fmt; + +#define FMT_MODULE_EXPORT export +#define FMT_MODULE_EXPORT_BEGIN export { +#define FMT_MODULE_EXPORT_END } + +// all library-provided declarations and definitions +// must be in the module purview to be exported +#include "fmt/format.h" +#include "fmt/args.h" +#include "fmt/color.h" +#include "fmt/compile.h" +#include "fmt/locale.h" +#include "fmt/chrono.h" +#include "fmt/printf.h" +#include "fmt/os.h" + +module : private; + +#include "format.cc" +#include "os.cc"