mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 04:14:27 +02:00
fix: ODR violations in C++ modules fixed for clang-18
This commit is contained in:
@@ -22,12 +22,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
#include <mp-units/bits/value_cast.h>
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/systems/angular/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/angular/units.h>
|
||||
|
||||
// IWYU pragma: begin_exports
|
||||
#include <cmath>
|
||||
|
@@ -22,9 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/dimension.h>
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
|
||||
namespace mp_units::angular {
|
||||
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/si/units.h>
|
||||
|
||||
namespace mp_units::cgs {
|
||||
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/si/si.h>
|
||||
|
||||
template<>
|
||||
inline constexpr std::optional<std::intmax_t> mp_units::known_first_factor<334'524'384'739> = 334'524'384'739;
|
||||
|
@@ -22,9 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/si/constants.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
namespace mp_units::iau {
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
|
||||
namespace mp_units::iec80000 {
|
||||
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/dimension.h>
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
||||
|
@@ -22,9 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/iec80000/quantities.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
namespace mp_units::iec80000 {
|
||||
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/international/international.h>
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/international/international.h>
|
||||
|
||||
namespace mp_units::imperial {
|
||||
|
||||
|
@@ -22,9 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/si/constants.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
namespace mp_units::international {
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
|
||||
namespace mp_units::isq {
|
||||
|
@@ -22,9 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/dimension.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
|
||||
namespace mp_units::isq {
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/base_quantities.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/base_quantities.h>
|
||||
|
||||
namespace mp_units::isq {
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
|
||||
namespace mp_units::isq {
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#include <mp-units/reference.h>
|
||||
#endif
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/isq/isq.h>
|
||||
|
||||
|
@@ -22,11 +22,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/system_reference.h>
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/prefixes.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
namespace mp_units::natural {
|
||||
|
||||
|
@@ -22,12 +22,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <chrono>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/prefixes.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <chrono>
|
||||
|
||||
namespace mp_units {
|
||||
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity.h>
|
||||
#endif
|
||||
#include <mp-units/systems/si/units.h>
|
||||
|
||||
namespace mp_units::si {
|
||||
|
@@ -22,13 +22,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
#include <mp-units/bits/value_cast.h>
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
// IWYU pragma: begin_exports
|
||||
#include <cmath>
|
||||
|
@@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
|
||||
namespace mp_units::si {
|
||||
|
||||
|
@@ -22,10 +22,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
// #include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/si_quantities.h>
|
||||
#include <mp-units/systems/si/prefixes.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
namespace mp_units {
|
||||
|
||||
@@ -55,17 +58,20 @@ inline constexpr struct radian : named_unit<"rad", metre / metre, kind_of<isq::a
|
||||
inline constexpr struct steradian : named_unit<"sr", square(metre) / square(metre), kind_of<isq::solid_angular_measure>> {} steradian;
|
||||
inline constexpr struct hertz : named_unit<"Hz", one / second, kind_of<isq::frequency>> {} hertz;
|
||||
inline constexpr struct newton : named_unit<"N", kilogram * metre / square(second)> {} newton;
|
||||
// inline constexpr struct newton : named_unit<"N", kilogram * metre / square(second), kind_of<isq::force>> {} newton;
|
||||
#ifdef pascal
|
||||
#pragma push_macro("pascal")
|
||||
#undef pascal
|
||||
#define MP_UNITS_REDEFINE_PASCAL
|
||||
#endif
|
||||
inline constexpr struct pascal : named_unit<"Pa", newton / square(metre)> {} pascal;
|
||||
// inline constexpr struct pascal : named_unit<"Pa", newton / square(metre), kind_of<isq::pressure>> {} pascal;
|
||||
#ifdef MP_UNITS_REDEFINE_PASCAL
|
||||
#pragma pop_macro("pascal")
|
||||
#undef MP_UNITS_REDEFINE_PASCAL
|
||||
#endif
|
||||
inline constexpr struct joule : named_unit<"J", newton * metre> {} joule;
|
||||
// inline constexpr struct joule : named_unit<"J", newton * metre, kind_of<isq::energy>> {} joule;
|
||||
inline constexpr struct watt : named_unit<"W", joule / second> {} watt;
|
||||
inline constexpr struct coulomb : named_unit<"C", ampere * second> {} coulomb;
|
||||
inline constexpr struct volt : named_unit<"V", watt / ampere> {} volt;
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/international/international.h>
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/international/international.h>
|
||||
|
||||
namespace mp_units::typographic {
|
||||
|
||||
|
@@ -22,8 +22,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/international/international.h>
|
||||
#ifndef MP_UNITS_IN_MODULE_INTERFACE
|
||||
#include <mp-units/unit.h>
|
||||
#endif
|
||||
#include <mp-units/systems/international/international.h>
|
||||
|
||||
namespace mp_units::usc {
|
||||
|
||||
|
@@ -9,6 +9,8 @@ export import mp_units.core;
|
||||
|
||||
export
|
||||
{
|
||||
#define MP_UNITS_IN_MODULE_INTERFACE
|
||||
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/cgs/cgs.h>
|
||||
#include <mp-units/systems/hep/hep.h>
|
||||
|
Reference in New Issue
Block a user