fix: preventing import std; in GMF

This commit is contained in:
Mateusz Pusz
2024-07-16 20:50:04 +02:00
parent 2411a7ef12
commit 27bd2690bd
4 changed files with 15 additions and 8 deletions

View File

@@ -22,9 +22,13 @@
#pragma once #pragma once
#define MP_UNITS_IN_GMF
#include <mp-units/bits/hacks.h> #include <mp-units/bits/hacks.h>
#include <mp-units/compat_macros.h> #include <mp-units/compat_macros.h>
#include <mp-units/ext/contracts.h> #include <mp-units/ext/contracts.h>
#ifndef MP_UNITS_IMPORT_STD
#include <array> #include <array>
#include <compare> #include <compare>
#include <concepts> #include <concepts>
@@ -46,9 +50,11 @@
#if __cpp_lib_text_encoding #if __cpp_lib_text_encoding
#include <text_encoding> #include <text_encoding>
#endif #endif
#endif
#if MP_UNITS_HOSTED #if MP_UNITS_HOSTED
#include <mp-units/ext/format.h> #include <mp-units/ext/format.h>
#ifndef MP_UNITS_IMPORT_STD
#include <cmath> #include <cmath>
#include <locale> #include <locale>
#include <ostream> #include <ostream>
@@ -56,3 +62,6 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#endif #endif
#endif
#undef MP_UNITS_IN_GMF

View File

@@ -35,12 +35,14 @@ MP_UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE
MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW
#include <fmt/format.h> #include <fmt/format.h>
MP_UNITS_DIAGNOSTIC_POP MP_UNITS_DIAGNOSTIC_POP
#else #else // MP_UNITS_USE_FMTLIB
#ifdef MP_UNITS_IMPORT_STD #ifdef MP_UNITS_IMPORT_STD
#ifndef MP_UNITS_IN_GMF
import std; import std;
#else #endif
#else // MP_UNITS_IMPORT_STD
#include <format> #include <format>
#endif #endif // MP_UNITS_IMPORT_STD
#endif #endif // MP_UNITS_USE_FMTLIB
#endif #endif

View File

@@ -22,9 +22,7 @@
module; module;
#ifndef MP_UNITS_IMPORT_STD
#include <mp-units/bits/core_gmf.h> #include <mp-units/bits/core_gmf.h>
#endif
export module mp_units.core; export module mp_units.core;

View File

@@ -22,10 +22,8 @@
module; module;
#ifndef MP_UNITS_IMPORT_STD
#include <mp-units/bits/core_gmf.h> #include <mp-units/bits/core_gmf.h>
#include <chrono> #include <chrono>
#endif
export module mp_units.systems; export module mp_units.systems;