mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 04:44:27 +02:00
build: formatting headers moved from compat_macros.h
to fmt.h
This commit is contained in:
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
Reference in New Issue
Block a user