From f267ebcd50c98470ea7ed46d6be5f1d44ff8adf7 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Mon, 12 Aug 2024 11:02:02 -0400 Subject: [PATCH] Deprecate `pascal` (#285) It conflicts with the `pascal` macro in ``. Yes, they really did define a lowercase-named macro in ``. As with `PI` (#247), the `#ifndef` should immediately unblock most users, but it's not a long-term solution, because it depends on order-of-includes. Therefore, we also deprecate `pascal` (as with `PI` in #250). I think a good rule of thumb is that deprecated constructs should be deprecated for at least one full minor release cycle, so we'll plan to delete it (along with `PI`) as part of 0.5.0. Fixes #284. --- au/code/au/units/pascals.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/au/code/au/units/pascals.hh b/au/code/au/units/pascals.hh index bc86df89..a2a81560 100644 --- a/au/code/au/units/pascals.hh +++ b/au/code/au/units/pascals.hh @@ -33,7 +33,13 @@ constexpr const char PascalsLabel::label[]; struct Pascals : decltype(Newtons{} / squared(Meters{})), PascalsLabel { using PascalsLabel::label; }; -constexpr auto pascal = SingularNameFor{}; + +#ifndef pascal +[[deprecated( + "Conflicts with the `pascal` macro from ; declare manually " + "instead.")]] constexpr auto pascal = SingularNameFor{}; +#endif + constexpr auto pascals = QuantityMaker{}; constexpr QuantityPointMaker pascals_pt{};