mirror of
https://github.com/gbdev/rgbds.git
synced 2026-06-13 20:22:11 +00:00
Do not support GCC 9 (#1978)
This will let us use C++20 features that GCC 9's experimental C++20 support did not yet cover, such as "concepts". This reverts some commits: -6bcd79b997-d5ce5329ea-728d14879b
This commit is contained in:
@@ -20,7 +20,7 @@ case "${OS%%-*}" in
|
|||||||
pkgs="$pkgs libz-mingw-w64-dev g++-mingw-w64-x86-64-win32"
|
pkgs="$pkgs libz-mingw-w64-dev g++-mingw-w64-x86-64-win32"
|
||||||
TOOLSET=
|
TOOLSET=
|
||||||
;;
|
;;
|
||||||
g++-9 | lcov)
|
g++-10 | lcov)
|
||||||
pkgs="$pkgs libpng-dev pkgconf $TOOLSET"
|
pkgs="$pkgs libpng-dev pkgconf $TOOLSET"
|
||||||
TOOLSET=
|
TOOLSET=
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ jobs:
|
|||||||
exclude: # Don't use `g++` on macOS; it's just an alias to `clang++`.
|
exclude: # Don't use `g++` on macOS; it's just an alias to `clang++`.
|
||||||
- { os: macos-15-intel, cxx: g++ }
|
- { os: macos-15-intel, cxx: g++ }
|
||||||
- { os: macos-26, cxx: g++ }
|
- { os: macos-26, cxx: g++ }
|
||||||
include: # Use `g++-9`, the earliest GCC version we support, on the earliest Ubuntu runner.
|
include: # Use `g++-10`, the earliest GCC version we support, on the earliest Ubuntu runner.
|
||||||
- { os: ubuntu-22.04, cxx: g++-9, buildsys: make }
|
- { os: ubuntu-22.04, cxx: g++-10, buildsys: make }
|
||||||
- { os: ubuntu-22.04, cxx: g++-9, buildsys: cmake }
|
- { os: ubuntu-22.04, cxx: g++-10, buildsys: cmake }
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ WARNFLAGS := -Wall -pedantic -Wno-unknown-warning-option -Wno-gnu-zero-variadic-
|
|||||||
# Overridable CXXFLAGS
|
# Overridable CXXFLAGS
|
||||||
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
||||||
# Non-overridable CXXFLAGS
|
# Non-overridable CXXFLAGS
|
||||||
# GCC 9 doesn't support `-std=c++20`, and all later GCCs treat it as equivalent to `-std=c++2a`.
|
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++20 -I include -fno-exceptions -fno-rtti
|
||||||
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++2a -I include -fno-exceptions -fno-rtti
|
|
||||||
# Overridable LDFLAGS
|
# Overridable LDFLAGS
|
||||||
LDFLAGS ?=
|
LDFLAGS ?=
|
||||||
# Non-overridable LDFLAGS
|
# Non-overridable LDFLAGS
|
||||||
@@ -257,7 +256,7 @@ tidy: src/asm/parser.hpp src/link/script.hpp
|
|||||||
iwyu:
|
iwyu:
|
||||||
$Qenv ${MAKE} \
|
$Qenv ${MAKE} \
|
||||||
CXX="include-what-you-use" \
|
CXX="include-what-you-use" \
|
||||||
REALCXXFLAGS="-std=c++2a -I include"
|
REALCXXFLAGS="-std=c++20 -I include"
|
||||||
|
|
||||||
# Target used in development to conveniently invoke RGBDS binaries with Wine.
|
# Target used in development to conveniently invoke RGBDS binaries with Wine.
|
||||||
wine-shim:
|
wine-shim:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
-std=c++2a
|
-std=c++20
|
||||||
-I
|
-I
|
||||||
include
|
include
|
||||||
-fno-exceptions
|
-fno-exceptions
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ struct Rgba {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(Rgba const &rhs) const { return toCSS() == rhs.toCSS(); }
|
bool operator==(Rgba const &rhs) const { return toCSS() == rhs.toCSS(); }
|
||||||
bool operator!=(Rgba const &rhs) const { return !operator==(rhs); }
|
|
||||||
|
|
||||||
// CGB colors are RGB555, so we use bit 15 to signify that the color is transparent instead
|
// CGB colors are RGB555, so we use bit 15 to signify that the color is transparent instead
|
||||||
// Since the rest of the bits don't matter then, we return 0x8000 exactly.
|
// Since the rest of the bits don't matter then, we return 0x8000 exactly.
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ class EnumSeq {
|
|||||||
EnumT operator*() const { return _value; }
|
EnumT operator*() const { return _value; }
|
||||||
|
|
||||||
bool operator==(Iterator const &rhs) const { return _value == rhs._value; }
|
bool operator==(Iterator const &rhs) const { return _value == rhs._value; }
|
||||||
bool operator!=(Iterator const &rhs) const { return !operator==(rhs); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -132,7 +131,6 @@ public:
|
|||||||
bool operator==(ZipIterator const &rhs) const {
|
bool operator==(ZipIterator const &rhs) const {
|
||||||
return std::get<0>(_iters) == std::get<0>(rhs._iters);
|
return std::get<0>(_iters) == std::get<0>(rhs._iters);
|
||||||
}
|
}
|
||||||
bool operator!=(ZipIterator const &rhs) const { return !operator==(rhs); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Only needed inside `zip` below.
|
// Only needed inside `zip` below.
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ private:
|
|||||||
SectionT &operator*() const { return *_piece; }
|
SectionT &operator*() const { return *_piece; }
|
||||||
|
|
||||||
bool operator==(Iterator const &rhs) const { return _piece == rhs._piece; }
|
bool operator==(Iterator const &rhs) const { return _piece == rhs._piece; }
|
||||||
bool operator!=(Iterator const &rhs) const { return !operator==(rhs); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
+2
-2
@@ -74,14 +74,14 @@ char const *printChar(int c);
|
|||||||
|
|
||||||
struct Uppercase {
|
struct Uppercase {
|
||||||
// FNV-1a hash of an uppercased string
|
// FNV-1a hash of an uppercased string
|
||||||
size_t operator()(std::string const &str) const {
|
constexpr size_t operator()(std::string const &str) const {
|
||||||
return std::accumulate(RANGE(str), size_t(0x811C9DC5), [](size_t hash, char c) {
|
return std::accumulate(RANGE(str), size_t(0x811C9DC5), [](size_t hash, char c) {
|
||||||
return (hash ^ toUpper(c)) * 16777619;
|
return (hash ^ toUpper(c)) * 16777619;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare two strings without case-sensitivity (by converting to uppercase)
|
// Compare two strings without case-sensitivity (by converting to uppercase)
|
||||||
bool operator()(std::string const &str1, std::string const &str2) const {
|
constexpr bool operator()(std::string const &str1, std::string const &str2) const {
|
||||||
return std::equal(RANGE(str1), RANGE(str2), [](char c1, char c2) {
|
return std::equal(RANGE(str1), RANGE(str2), [](char c1, char c2) {
|
||||||
return toUpper(c1) == toUpper(c2);
|
return toUpper(c1) == toUpper(c2);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#include "asm/fixpoint.hpp"
|
#include "asm/fixpoint.hpp"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <numbers>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// Ideally we'd use `std::numbers::pi`, but GCC 9 doesn't support it.
|
static constexpr double tau = std::numbers::pi * 2;
|
||||||
static constexpr double tau = 3.141592653589793238462643383279502884L * 2;
|
|
||||||
|
|
||||||
static double fix2double(int32_t i, int32_t q) {
|
static double fix2double(int32_t i, int32_t q) {
|
||||||
return i / pow(2.0, q);
|
return i / pow(2.0, q);
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ private:
|
|||||||
AssignedSetsIter() = default;
|
AssignedSetsIter() = default;
|
||||||
|
|
||||||
bool operator==(AssignedSetsIter const &rhs) const { return _iter == rhs._iter; }
|
bool operator==(AssignedSetsIter const &rhs) const { return _iter == rhs._iter; }
|
||||||
bool operator!=(AssignedSetsIter const &rhs) const { return !operator==(rhs); }
|
|
||||||
|
|
||||||
AssignedSetsIter &operator++() {
|
AssignedSetsIter &operator++() {
|
||||||
++_iter;
|
++_iter;
|
||||||
|
|||||||
@@ -263,7 +263,6 @@ struct Image {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(Iterator const &rhs) const { return coords() == rhs.coords(); }
|
bool operator==(Iterator const &rhs) const { return coords() == rhs.coords(); }
|
||||||
bool operator!=(Iterator const &rhs) const { return !operator==(rhs); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user