diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index ed00178900b..6a84c8c4d5e 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -493,6 +493,10 @@ namespace cpp11{ # define CGAL_FALLTHROUGH while(false){} #endif +#if __cpp_lib_format >= 201907L || __cplusplus >= 202000L || _MSVC_LANG >= 202000L +# define CGAL_CAN_USE_CXX20_FORMAT 1 +#endif + #ifndef CGAL_NO_ASSERTIONS # define CGAL_NO_ASSERTIONS_BOOL false #else diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 0a0441857a2..aa7d650e72b 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -995,8 +995,7 @@ inline void read_float_or_quotient(std::istream& is, Rat &z) } // namespace CGAL -#if __has_include() && \ - (__cpp_lib_format >= 201907L || __cplusplus >= 202000L || _MSVC_LANG >= 202000L) +#if CGAL_CAN_USE_CXX20_FORMAT # include # include @@ -1041,7 +1040,7 @@ struct formatter, CharT> : public std::formatter= 201907L +#endif // CGAL_CAN_USE_CXX20_FORMAT #include