mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-23 14:29:23 -05:00
Gcc12 related fixes (#1138)
* GCC12 related fixes but still compiles on GCC9 * Suppress warnings about volatile += * Enable c++20 if supported by the compiler On gcc12 we need to use -std=c++20 since constexpr .c_str() on std::string is only officially available since c++20 and the new gcc wouldnt let us use it with older standard * code format --------- Co-authored-by: Eisenberger Tamas <e.tamas@iwstudio.hu>
This commit is contained in:
parent
47eda54d6a
commit
a2e5e03f07
@ -27,6 +27,8 @@
|
||||
|
||||
enable_language(C CXX ASM)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
project(application)
|
||||
|
||||
# Compiler options here.
|
||||
@ -36,7 +38,13 @@ set(USE_OPT "-Os -g --specs=nano.specs")
|
||||
set(USE_COPT "-std=gnu99")
|
||||
|
||||
# C++ specific options here (added to USE_OPT).
|
||||
set(USE_CPPOPT "-std=c++17 -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized")
|
||||
check_cxx_compiler_flag("-std=c++20" cpp20_supported)
|
||||
if(cpp20_supported)
|
||||
set(USE_CPPOPT "-std=c++20")
|
||||
else()
|
||||
set(USE_CPPOPT "-std=c++17")
|
||||
endif()
|
||||
set(USE_CPPOPT "${USE_CPPOPT} -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wno-volatile")
|
||||
|
||||
# Enable this if you want the linker to remove unused code and data
|
||||
set(USE_LINK_GC yes)
|
||||
|
@ -38,10 +38,6 @@
|
||||
|
||||
namespace std {
|
||||
|
||||
constexpr bool operator==(const tpms::TransponderID& lhs, const tpms::TransponderID& rhs) {
|
||||
return (lhs.value() == rhs.value());
|
||||
}
|
||||
|
||||
} /* namespace std */
|
||||
|
||||
struct TPMSRecentEntry {
|
||||
|
@ -22,6 +22,8 @@
|
||||
#ifndef __MAX283X_H__
|
||||
#define __MAX283X_H__
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "rf_path.hpp"
|
||||
|
||||
namespace max283x {
|
||||
|
@ -162,8 +162,8 @@ constexpr ConfigAmp config_amp(
|
||||
const Direction direction,
|
||||
const Band band) {
|
||||
return {{
|
||||
{.direction = direction, .band = band, .amplify = false},
|
||||
{.direction = direction, .band = band, .amplify = true},
|
||||
Config(direction, band, false),
|
||||
Config(direction, band, true),
|
||||
}};
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ GeoMap::GeoMap(
|
||||
}
|
||||
|
||||
void GeoMap::paint(Painter& painter) {
|
||||
u_int16_t line;
|
||||
uint16_t line;
|
||||
std::array<ui::Color, 240> map_line_buffer;
|
||||
const auto r = screen_rect();
|
||||
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
enable_language(C CXX ASM)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
project(baseband_shared)
|
||||
|
||||
# Compiler options here.
|
||||
@ -36,7 +38,13 @@ set(USE_OPT "-O3 -g -falign-functions=16 -fno-math-errno --specs=nano.specs")
|
||||
set(USE_COPT "-std=gnu99")
|
||||
|
||||
# C++ specific options here (added to USE_OPT).
|
||||
set(USE_CPPOPT "-std=c++17 -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized")
|
||||
check_cxx_compiler_flag("-std=c++20" cpp20_supported)
|
||||
if(cpp20_supported)
|
||||
set(USE_CPPOPT "-std=c++20")
|
||||
else()
|
||||
set(USE_CPPOPT "-std=c++17")
|
||||
endif()
|
||||
set(USE_CPPOPT "${USE_CPPOPT} -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wno-volatile")
|
||||
|
||||
# Enable this if you want the linker to remove unused code and data
|
||||
set(USE_LINK_GC yes)
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
|
||||
namespace jtag {
|
||||
namespace tap {
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <array>
|
||||
|
||||
#include "baseband.hpp"
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define __TONESETS_H__
|
||||
|
||||
#include <memory>
|
||||
#include <array>
|
||||
|
||||
#define TONES_SAMPLERATE 1536000
|
||||
#define TONES_DELTA_COEF(sr) ((1ULL << 32) / sr)
|
||||
|
@ -60,6 +60,10 @@ class TransponderID {
|
||||
return id_;
|
||||
}
|
||||
|
||||
constexpr bool operator==(const TransponderID& other) const {
|
||||
return id_ == other.id_;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t id_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user