Skip to content

Commit

Permalink
Patch because of old compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaubart committed Dec 11, 2024
1 parent 2704fe8 commit a99c41d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions 0001-remove-one-more-inequality-op.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
diff --git a/src/Geo/Flat/FlatGeoPoint.hpp b/src/Geo/Flat/FlatGeoPoint.hpp
index 0e684e652d..5f69b8dc24 100644
--- a/src/Geo/Flat/FlatGeoPoint.hpp
+++ b/src/Geo/Flat/FlatGeoPoint.hpp
@@ -69,8 +69,9 @@ struct FlatGeoPoint : IntPoint2D {
return ::DotProduct(*this, other);
}

- constexpr bool operator==(const FlatGeoPoint &) const noexcept = default;
- constexpr bool operator!=(const FlatGeoPoint &) const noexcept = default;
+ constexpr bool operator==(const FlatGeoPoint &other) const noexcept {
+ return IntPoint2D::operator==(other);
+ }

[[gnu::pure]]
bool Sort(const FlatGeoPoint& sp) const noexcept {
@@ -107,8 +108,9 @@ struct AFlatGeoPoint : public FlatGeoPoint {
y = (y >> 2) << 2;
}

- constexpr bool operator==(const AFlatGeoPoint &) const noexcept = default;
- constexpr bool operator!=(const AFlatGeoPoint &) const noexcept = default;
+ constexpr bool operator==(const AFlatGeoPoint &other) const noexcept {
+ return FlatGeoPoint::operator==(other) && (altitude == other.altitude);
+ }

/**
* Ordering operator, used for set ordering. Uses lexicographic comparison.
diff --git a/src/Geo/GeoPoint.hpp b/src/Geo/GeoPoint.hpp
index 6e3a35d478..557354011f 100644
--- a/src/Geo/GeoPoint.hpp
+++ b/src/Geo/GeoPoint.hpp
@@ -263,8 +263,13 @@ struct GeoPoint {
[[gnu::pure]]
GeoPoint Middle(const GeoPoint &other) const noexcept;

- constexpr bool operator==(const GeoPoint &) const noexcept = default;
- constexpr bool operator!=(const GeoPoint &) const noexcept = default;
+ // constexpr bool operator==(const GeoPoint &) const noexcept = default;
+ constexpr bool Equals(const GeoPoint other) const noexcept {
+ return longitude == other.longitude && latitude == other.latitude;
+ }
+ constexpr bool operator==(const GeoPoint other) const noexcept {
+ return Equals(other);
+ }
};

static_assert(std::is_trivial<GeoPoint>::value, "type is not trivial");
diff --git a/src/Math/Point2D.hpp b/src/Math/Point2D.hpp
index 49e05dac5b..f291901769 100644
--- a/src/Math/Point2D.hpp
+++ b/src/Math/Point2D.hpp
@@ -32,8 +32,10 @@ struct Point2D {
:x(static_cast<scalar_type>(src.x)),
y(static_cast<scalar_type>(src.y)) {}

- constexpr bool operator==(const Point2D<T, PT> &) const noexcept = default;
- constexpr bool operator!=(const Point2D<T, PT> &) const noexcept = default;
+ // constexpr bool operator==(const Point2D<T, PT> &) const noexcept = default;
+ constexpr bool operator==(const Point2D<T, PT> &other) const noexcept {
+ return x == other.x && y == other.y;
+ }

constexpr Point2D<T, PT> operator+(Point2D<T, PT> other) const noexcept {
return { scalar_type(x + other.x), scalar_type(y + other.y) };
diff --git a/src/PageSettings.hpp b/src/PageSettings.hpp
index c6a56bd661..6642c0e54a 100644
--- a/src/PageSettings.hpp
+++ b/src/PageSettings.hpp
@@ -33,8 +33,12 @@ struct PageLayout
panel = 0;
}

- constexpr bool operator==(const InfoBoxConfig &other) const noexcept = default;
- constexpr bool operator!=(const InfoBoxConfig &other) const noexcept = default;
+ // constexpr bool operator==(const InfoBoxConfig &other) const noexcept = default;
+ bool operator==(const InfoBoxConfig &other) const {
+ return enabled == other.enabled &&
+ auto_switch == other.auto_switch &&
+ panel == other.panel;
+ }
};

bool valid;
@@ -138,8 +142,13 @@ struct PageLayout
std::span<char> buffer,
const bool concise=false) const noexcept;

- constexpr bool operator==(const PageLayout &other) const noexcept = default;
- constexpr bool operator!=(const PageLayout &other) const noexcept = default;
+ // constexpr bool operator==(const PageLayout &other) const noexcept = default;
+ bool operator==(const PageLayout &other) const {
+ return valid == other.valid &&
+ main == other.main &&
+ bottom == other.bottom &&
+ infobox_config == other.infobox_config;
+ }
};

struct PageSettings {
File renamed without changes.

0 comments on commit a99c41d

Please sign in to comment.