diff --git a/src/fmt.cc b/src/fmt.cc index 2dc4ef2f64d9..d4656007b2b4 100644 --- a/src/fmt.cc +++ b/src/fmt.cc @@ -1,4 +1,6 @@ +#ifdef FMT_MODULE module; +#endif #ifdef _MSVC_LANG # define FMT_CPLUSPLUS _MSVC_LANG @@ -6,92 +8,98 @@ module; # define FMT_CPLUSPLUS __cplusplus #endif +#ifndef FMT_IMPORT_STD_MODULE + // Put all implementation-provided headers into the global module fragment // to prevent attachment to this module. -#ifndef FMT_IMPORT_STD -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# if FMT_CPLUSPLUS > 202002L -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#else -# include -# include -# include -# include -#endif -#include -#include -#include +# ifndef FMT_IMPORT_STD +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# if FMT_CPLUSPLUS > 202002L +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# else +# include +# include +# include +# include +# endif // FMT_IMPORT_STD -#if __has_include() -# include -#endif -#if defined(_MSC_VER) || defined(__MINGW32__) -# include -#endif -#if defined __APPLE__ || defined(__FreeBSD__) -# include -#endif -#if __has_include() -# include -#endif -#if (__has_include() || defined(__APPLE__) || \ +# include +# include +# include + +# if __has_include() +# include +# endif +# if defined(_MSC_VER) || defined(__MINGW32__) +# 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 +# include +# include +# include +# ifndef _WIN32 +# include +# else +# include +# endif # endif -#endif -#ifdef _WIN32 -# if defined(__GLIBCXX__) -# include -# include +# ifdef _WIN32 +# if defined(__GLIBCXX__) +# include +# include +# endif +# define WIN32_LEAN_AND_MEAN +# include # endif -# define WIN32_LEAN_AND_MEAN -# include -#endif +#endif // FMT_IMPORT_STD_MODULE +#ifdef FMT_MODULE export module fmt; -#ifdef FMT_IMPORT_STD +# ifdef FMT_IMPORT_STD_MODULE import std; -#endif +# endif +#endif // FMT_MODULE #define FMT_EXPORT export #define FMT_BEGIN_EXPORT export { @@ -130,9 +138,11 @@ extern "C++" { } #endif +#ifdef FMT_MODULE // gcc doesn't yet implement private module fragments -#if !FMT_GCC_VERSION +# if !FMT_GCC_VERSION module :private; +# endif #endif #ifdef FMT_ATTACH_TO_GLOBAL_MODULE