diff --git a/src/core/include/mp-units/bits/core_gmf.h b/src/core/include/mp-units/bits/core_gmf.h index 3f2953439..f5392c21c 100644 --- a/src/core/include/mp-units/bits/core_gmf.h +++ b/src/core/include/mp-units/bits/core_gmf.h @@ -22,9 +22,13 @@ #pragma once +#define MP_UNITS_IN_GMF + #include #include #include + +#ifndef MP_UNITS_IMPORT_STD #include #include #include @@ -46,9 +50,11 @@ #if __cpp_lib_text_encoding #include #endif +#endif #if MP_UNITS_HOSTED #include +#ifndef MP_UNITS_IMPORT_STD #include #include #include @@ -56,3 +62,6 @@ #include #include #endif +#endif + +#undef MP_UNITS_IN_GMF diff --git a/src/core/include/mp-units/ext/format.h b/src/core/include/mp-units/ext/format.h index 382d02a56..5d8c1fd2e 100644 --- a/src/core/include/mp-units/ext/format.h +++ b/src/core/include/mp-units/ext/format.h @@ -35,12 +35,14 @@ MP_UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW #include MP_UNITS_DIAGNOSTIC_POP -#else +#else // MP_UNITS_USE_FMTLIB #ifdef MP_UNITS_IMPORT_STD +#ifndef MP_UNITS_IN_GMF import std; -#else -#include -#endif #endif +#else // MP_UNITS_IMPORT_STD +#include +#endif // MP_UNITS_IMPORT_STD +#endif // MP_UNITS_USE_FMTLIB #endif diff --git a/src/core/mp-units-core.cpp b/src/core/mp-units-core.cpp index eb0a3c206..f56a846df 100644 --- a/src/core/mp-units-core.cpp +++ b/src/core/mp-units-core.cpp @@ -22,9 +22,7 @@ module; -#ifndef MP_UNITS_IMPORT_STD #include -#endif export module mp_units.core; diff --git a/src/systems/mp-units-systems.cpp b/src/systems/mp-units-systems.cpp index 71ce35c7c..6c2207ee4 100644 --- a/src/systems/mp-units-systems.cpp +++ b/src/systems/mp-units-systems.cpp @@ -22,10 +22,8 @@ module; -#ifndef MP_UNITS_IMPORT_STD #include #include -#endif export module mp_units.systems;