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

View File

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

View File

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

View File

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