Fix compilation with GCC 9

This commit is contained in:
ISSOtm
2026-04-26 14:46:11 +02:00
committed by Rangi
parent 6bcd79b997
commit d5ce5329ea
3 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ WARNFLAGS := -Wall -pedantic -Wno-unknown-warning-option -Wno-gnu-zero-variadic-
# Overridable CXXFLAGS
CXXFLAGS ?= -O3 -flto -DNDEBUG
# Non-overridable CXXFLAGS
REALCXXFLAGS := ${CXXFLAGS} ${WARNFLAGS} -std=c++20 -I include -fno-exceptions -fno-rtti
# 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++2a -I include -fno-exceptions -fno-rtti
# Overridable LDFLAGS
LDFLAGS ?=
# Non-overridable LDFLAGS
+2 -2
View File
@@ -50,14 +50,14 @@ char const *printChar(int c);
struct Uppercase {
// FNV-1a hash of an uppercased string
constexpr size_t operator()(std::string const &str) const {
size_t operator()(std::string const &str) const {
return std::accumulate(RANGE(str), size_t(0x811C9DC5), [](size_t hash, char c) {
return (hash ^ toUpper(c)) * 16777619;
});
}
// Compare two strings without case-sensitivity (by converting to uppercase)
constexpr bool operator()(std::string const &str1, std::string const &str2) const {
bool operator()(std::string const &str1, std::string const &str2) const {
return std::equal(RANGE(str1), RANGE(str2), [](char c1, char c2) {
return toUpper(c1) == toUpper(c2);
});
+2 -2
View File
@@ -5,10 +5,10 @@
#include "asm/fixpoint.hpp"
#include <math.h>
#include <numbers>
#include <stdint.h>
static constexpr double tau = std::numbers::pi * 2;
// Ideally we'd use `std::numbers::pi`, but GCC 9 doesn't support it.
static constexpr double tau = 3.141592653589793238462643383279502884L * 2;
static double fix2double(int32_t i, int32_t q) {
return i / pow(2.0, q);