Skip to content

Commit

Permalink
Deprecate pascal (#285)
Browse files Browse the repository at this point in the history
It conflicts with the `pascal` macro in `<Windows.h>`.  Yes, they really
did define a lowercase-named macro in `<Windows.h>`.

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.
  • Loading branch information
chiphogg authored Aug 12, 2024
1 parent 52b93f4 commit f267ebc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion au/code/au/units/pascals.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ constexpr const char PascalsLabel<T>::label[];
struct Pascals : decltype(Newtons{} / squared(Meters{})), PascalsLabel<void> {
using PascalsLabel<void>::label;
};
constexpr auto pascal = SingularNameFor<Pascals>{};

#ifndef pascal
[[deprecated(
"Conflicts with the `pascal` macro from <Windows.h>; declare manually "
"instead.")]] constexpr auto pascal = SingularNameFor<Pascals>{};
#endif

constexpr auto pascals = QuantityMaker<Pascals>{};
constexpr QuantityPointMaker<Pascals> pascals_pt{};

Expand Down

0 comments on commit f267ebc

Please sign in to comment.