build: formatting headers moved from compat_macros.h to fmt.h

This commit is contained in:
Mateusz Pusz
2024-04-22 19:21:18 +02:00
parent 795277cfeb
commit e20492e159
2 changed files with 15 additions and 8 deletions

View File

@@ -36,6 +36,21 @@
#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

@@ -52,12 +52,6 @@
#if MP_UNITS_USE_FMTLIB #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
#define MP_UNITS_STD_FMT fmt #define MP_UNITS_STD_FMT fmt
#define MP_UNITS_FMT_LOCALE(loc) (loc).template get<std::locale>() #define MP_UNITS_FMT_LOCALE(loc) (loc).template get<std::locale>()
#define MP_UNITS_FMT_TO_ARG_ID(arg) (arg) #define MP_UNITS_FMT_TO_ARG_ID(arg) (arg)
@@ -83,8 +77,6 @@ MP_UNITS_DIAGNOSTIC_POP
#error "std::formatting facility not supported" #error "std::formatting facility not supported"
#endif #endif
#include <format>
#define MP_UNITS_STD_FMT std #define MP_UNITS_STD_FMT std
#define MP_UNITS_FMT_LOCALE(loc) loc #define MP_UNITS_FMT_LOCALE(loc) loc
#define MP_UNITS_FMT_TO_ARG_ID(arg) static_cast<std::size_t>(arg) #define MP_UNITS_FMT_TO_ARG_ID(arg) static_cast<std::size_t>(arg)