refactor: text formatting library header files are no longer included in compat_macros.h

This commit is contained in:
Mateusz Pusz
2024-06-10 22:04:41 +02:00
parent ed53cf03f0
commit e90cffcbda
35 changed files with 101 additions and 43 deletions
+1
View File
@@ -46,6 +46,7 @@ add_mp_units_module(
include/mp-units/ext/algorithm.h
include/mp-units/ext/contracts.h
include/mp-units/ext/fixed_string.h
include/mp-units/ext/format.h
include/mp-units/ext/prime.h
include/mp-units/ext/type_name.h
include/mp-units/ext/type_traits.h
+1 -11
View File
@@ -45,23 +45,13 @@
#include <utility>
#if MP_UNITS_HOSTED
#include <mp-units/ext/format.h>
#include <cmath>
#include <locale>
#include <ostream>
#include <random>
#include <sstream>
#include <string>
#if MP_UNITS_USE_FMTLIB
MP_UNITS_DIAGNOSTIC_PUSH
MP_UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE
MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW
#include <fmt/format.h>
MP_UNITS_DIAGNOSTIC_POP
#else
#include <format>
#endif
#endif
#if __cpp_lib_text_encoding
+1
View File
@@ -41,6 +41,7 @@
#include <limits>
#include <string_view>
#include <mp-units/ext/contracts.h>
#include <mp-units/ext/format.h>
#endif
// most of the below code is based on/copied from fmtlib
-12
View File
@@ -83,18 +83,6 @@
#ifndef MP_UNITS_IN_MODULE_INTERFACE
// IWYU pragma: begin_exports
#if MP_UNITS_USE_FMTLIB
MP_UNITS_DIAGNOSTIC_PUSH
MP_UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE
MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW
#include <fmt/format.h>
MP_UNITS_DIAGNOSTIC_POP
#else
#include <format>
#endif
// IWYU pragma: end_exports
#endif
#endif // MP_UNITS_HOSTED
+42
View File
@@ -0,0 +1,42 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#ifndef MP_UNITS_IN_MODULE_INTERFACE
#include <mp-units/bits/requires_hosted.h>
//
#include <mp-units/bits/hacks.h>
#include <mp-units/compat_macros.h>
#if MP_UNITS_USE_FMTLIB
MP_UNITS_DIAGNOSTIC_PUSH
MP_UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE
MP_UNITS_DIAGNOSTIC_IGNORE_SHADOW
#include <fmt/format.h>
MP_UNITS_DIAGNOSTIC_POP
#else
#include <format>
#endif
#endif