commit bf78737c596b04b12e44540ff2a846d2a2999764
parent 250ba75ea88e017af4e19b7f52dbe76ff33efd1e
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sat, 7 Sep 2019 20:39:11 -0400
fix compilation with GCC 9
Diffstat:
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/linux.tup b/linux.tup
@@ -20,7 +20,7 @@ SWELL := $(WDL)/swell
WDLSOURCE += $(SWELL)/swell-modstub-generic.cpp
export CURLSO
-LDFLAGS := -lstdc++ -lpthread -ldl -lcrypto -l${CURLSO:-curl} -lsqlite3 -lz
+LDFLAGS := -lstdc++ -lpthread -ldl -lcrypto -l${CURLSO:-curl} -lm -lsqlite3 -lz
LDFLAGS += -Wl,--gc-sections
SOFLAGS := -shared
diff --git a/src/version.hpp b/src/version.hpp
@@ -36,6 +36,8 @@ public:
VersionName(const std::string &);
VersionName(const VersionName &);
+ VersionName &operator=(const VersionName &) = default;
+
void parse(const std::string &);
bool tryParse(const std::string &, std::string *errorOut = nullptr);
@@ -44,12 +46,13 @@ public:
const std::string &toString() const { return m_string; }
int compare(const VersionName &) const;
- bool operator<(const VersionName &o) const { return compare(o) < 0; }
- bool operator<=(const VersionName &o) const { return compare(o) <= 0; }
- bool operator>(const VersionName &o) const { return compare(o) > 0; }
- bool operator>=(const VersionName &o) const { return compare(o) >= 0; }
- bool operator==(const VersionName &o) const { return compare(o) == 0; }
- bool operator!=(const VersionName &o) const { return compare(o) != 0; }
+
+#define COMPOP(op) \
+ bool operator op (const VersionName &o) const { return compare(o) op 0; }
+
+ COMPOP(<) COMPOP(<=) COMPOP(>) COMPOP(>=) COMPOP(==) COMPOP(!=)
+
+#undef COMPOP
private:
typedef uint16_t Numeric;