Skip to content

Commit

Permalink
fix: the remaining pascal macro conflicts fixed
Browse files Browse the repository at this point in the history
Resolves #605
  • Loading branch information
mpusz committed Aug 25, 2024
1 parent 77625d6 commit f0e19d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/systems/include/mp-units/systems/si/unit_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ inline constexpr auto YN = yotta<newton>;
inline constexpr auto RN = ronna<newton>;
inline constexpr auto QN = quetta<newton>;

#ifdef pascal
#pragma push_macro("pascal")
#undef pascal
#define MP_UNITS_REDEFINE_PASCAL
#endif
inline constexpr auto qPa = quecto<pascal>;
inline constexpr auto rPa = ronto<pascal>;
inline constexpr auto yPa = yocto<pascal>;
Expand All @@ -343,6 +348,10 @@ inline constexpr auto ZPa = zetta<pascal>;
inline constexpr auto YPa = yotta<pascal>;
inline constexpr auto RPa = ronna<pascal>;
inline constexpr auto QPa = quetta<pascal>;
#ifdef MP_UNITS_REDEFINE_PASCAL
#pragma pop_macro("pascal")
#undef MP_UNITS_REDEFINE_PASCAL
#endif

inline constexpr auto qJ = quecto<joule>;
inline constexpr auto rJ = ronto<joule>;
Expand Down
9 changes: 9 additions & 0 deletions src/systems/include/mp-units/systems/usc.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ inline constexpr struct troy_once final : named_unit<"oz t", mag<20> * pennyweig
inline constexpr struct troy_pound final : named_unit<"lb t", mag<12> * troy_once> {} troy_pound;

// https://en.wikipedia.org/wiki/Inch_of_mercury
#ifdef pascal
#pragma push_macro("pascal")
#undef pascal
#define MP_UNITS_REDEFINE_PASCAL
#endif
inline constexpr struct inch_of_mercury final : named_unit<"inHg", mag_ratio<3'386'389, 1'000> * si::pascal> {} inch_of_mercury;
#ifdef MP_UNITS_REDEFINE_PASCAL
#pragma pop_macro("pascal")
#undef MP_UNITS_REDEFINE_PASCAL
#endif

// https://en.wikipedia.org/wiki/United_States_customary_units#Temperature
inline constexpr struct zeroth_degree_Fahrenheit final : relative_point_origin<absolute<mag_ratio<5, 9> * si::degree_Celsius>(-32)> {} zeroth_degree_Fahrenheit;
Expand Down

0 comments on commit f0e19d0

Please sign in to comment.