build: formatting headers moved back to compat_macros.h but this time they are included conditionally

This commit is contained in:
Mateusz Pusz
2024-04-23 08:56:27 +02:00
parent 5449fe7418
commit 8580c59875
3 changed files with 15 additions and 26 deletions

View File

@@ -34,17 +34,6 @@
#include <cstdlib> #include <cstdlib>
#include <ostream> #include <ostream>
#include <string_view> #include <string_view>
#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 #endif
MP_UNITS_EXPORT MP_UNITS_EXPORT

View File

@@ -36,21 +36,6 @@
#include <concepts> #include <concepts>
#include <limits> #include <limits>
#include <string_view> #include <string_view>
#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
#ifndef MP_UNITS_IN_MODULE_INTERFACE
#include <cstdint>
#endif
#endif #endif
// most of the below code is based on/copied from fmtlib // most of the below code is based on/copied from fmtlib

View File

@@ -84,3 +84,18 @@
#define MP_UNITS_THROW(arg) throw arg #define MP_UNITS_THROW(arg) throw arg
#endif #endif
#ifndef MP_UNITS_IN_MODULE_INTERFACE
#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