diff --git a/include/fmt/format.h b/include/fmt/format.h index e59477f9..9e6570d6 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -38,6 +38,8 @@ # define FMT_REMOVE_TRANSITIVE_INCLUDES #endif +#include "base.h" + #ifndef FMT_MODULE # include // std::signbit # include // uint32_t @@ -51,23 +53,19 @@ # include // std::runtime_error # include // std::string # include // std::system_error -#endif - -#include "base.h" // Checking FMT_CPLUSPLUS for warning suppression in MSVC. -#if FMT_HAS_INCLUDE() && FMT_CPLUSPLUS > 201703L && !defined(FMT_MODULE) -# include // std::bit_cast -#endif +# if FMT_HAS_INCLUDE() && FMT_CPLUSPLUS > 201703L +# include // std::bit_cast +# endif // libc++ supports string_view in pre-c++17. -#if FMT_HAS_INCLUDE() && \ - (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION)) -# if !defined(FMT_MODULE) +# if FMT_HAS_INCLUDE() && \ + (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION)) # include +# define FMT_USE_STRING_VIEW # endif -# define FMT_USE_STRING_VIEW -#endif +#endif // FMT_MODULE #if defined __cpp_inline_variables && __cpp_inline_variables >= 201606L # define FMT_INLINE_VARIABLE inline diff --git a/include/fmt/os.h b/include/fmt/os.h index 5344e5c2..5c85ea08 100644 --- a/include/fmt/os.h +++ b/include/fmt/os.h @@ -8,20 +8,18 @@ #ifndef FMT_OS_H_ #define FMT_OS_H_ +#include "format.h" + #ifndef FMT_MODULE # include # include # include # include // std::system_error -#endif -#include "format.h" - -#if defined __APPLE__ || defined(__FreeBSD__) -# if FMT_HAS_INCLUDE() && !defined(FMT_MODULE) -# include // for LC_NUMERIC_MASK on OS X +# if FMT_HAS_INCLUDE() +# include // LC_NUMERIC_MASK on macOS # endif -#endif +#endif // FMT_MODULE #ifndef FMT_USE_FCNTL // UWP doesn't provide _pipe. diff --git a/include/fmt/std.h b/include/fmt/std.h index 01635e18..09f3d322 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -8,6 +8,9 @@ #ifndef FMT_STD_H_ #define FMT_STD_H_ +#include "format.h" +#include "ostream.h" + #ifndef FMT_MODULE # include # include @@ -20,16 +23,7 @@ # include # include # include -#endif -#include "format.h" -#include "ostream.h" - -#if FMT_HAS_INCLUDE() -# include -#endif - -#ifndef FMT_MODULE // Checking FMT_CPLUSPLUS for warning suppression in MSVC. # if FMT_CPLUSPLUS >= 201703L # if FMT_HAS_INCLUDE() @@ -50,6 +44,10 @@ # if FMT_CPLUSPLUS > 201703L && FMT_HAS_INCLUDE() # include # endif +#endif // FMT_MODULE + +#if FMT_HAS_INCLUDE() +# include #endif // GCC 4 does not support FMT_HAS_INCLUDE. diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index 6c19bf3e..b1f39ed2 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -8,16 +8,15 @@ #ifndef FMT_XCHAR_H_ #define FMT_XCHAR_H_ -#ifndef FMT_MODULE -# include -#endif - #include "color.h" #include "format.h" #include "ranges.h" -#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) && !defined(FMT_MODULE) -# include +#ifndef FMT_MODULE +# include +# if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +# include +# endif #endif FMT_BEGIN_NAMESPACE