ams: build with -std=gnu++23

This commit is contained in:
Michael Scire 2024-05-26 15:39:00 -07:00 committed by SciresM
parent f35c94810c
commit 1609f804f2
9 changed files with 15 additions and 11 deletions

View file

@ -44,7 +44,7 @@ else ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),clang)
export ATMOSPHERE_CFLAGS += -Wno-c99-designator -Wno-gnu-alignof-expression -Wno-unused-private-field
endif
export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++20 -Wno-invalid-offsetof
export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++23 -Wno-invalid-offsetof
export ATMOSPHERE_ASFLAGS :=

View file

@ -73,7 +73,7 @@ namespace ams::emummc {
/* Retrieve and cache values. */
{
typename std::aligned_storage<2 * (MaxDirLen + 1), os::MemoryPageSize>::type path_storage;
alignas(os::MemoryPageSize) std::byte path_storage[2 * (MaxDirLen + 1)];
struct {
char file_path[MaxDirLen + 1];

View file

@ -23,8 +23,8 @@ namespace ams::fs {
#if defined(ATMOSPHERE_OS_HORIZON)
namespace {
constinit std::aligned_storage_t<0x80> g_fsp_service_object_buffer;
constinit std::aligned_storage_t<0x80> g_fsp_ldr_service_object_buffer;
alignas(0x10) constinit std::byte g_fsp_service_object_buffer[0x80] = {};
alignas(0x10) constinit std::byte g_fsp_ldr_service_object_buffer[0x80] = {};
constinit bool g_use_static_fsp_service_object_buffer = false;
constinit bool g_use_static_fsp_ldr_service_object_buffer = false;

View file

@ -20,7 +20,7 @@ namespace ams::fssrv::impl {
namespace {
constinit std::aligned_storage<0x80>::type g_static_buffer_for_program_info_for_initial_process = {};
alignas(0x10) constinit std::byte g_static_buffer_for_program_info_for_initial_process[0x80] = {};
template<typename T>
class StaticAllocatorForProgramInfoForInitialProcess : public std::allocator<T> {

View file

@ -41,7 +41,7 @@ namespace ams::htc::server::rpc {
#else
static constexpr size_t MaxTaskSize = 0xE1D8;
#endif
using TaskStorage = typename std::aligned_storage<MaxTaskSize, alignof(void *)>::type;
struct TaskStorage { alignas(alignof(void *)) std::byte _storage[MaxTaskSize]; };
private:
bool m_valid[MaxRpcCount]{};
TaskStorage m_storages[MaxRpcCount]{};

View file

@ -19,9 +19,13 @@
namespace ams::osdbg::impl {
template<size_t Size, int NumPointers, size_t Alignment>
using AlignedStorageIlp32 = typename std::aligned_storage<Size + NumPointers * sizeof(u32), Alignment>::type;
struct AlignedStorageIlp32 {
alignas(Alignment) std::byte _storage[Size + NumPointers * sizeof(u32)];
};
template<size_t Size, int NumPointers, size_t Alignment>
using AlignedStorageLp64 = typename std::aligned_storage<Size + NumPointers * sizeof(u64), Alignment>::type;
struct AlignedStorageLp64 {
alignas(Alignment) std::byte _storage[Size + NumPointers * sizeof(u64)];
};
}

View file

@ -22,7 +22,7 @@ namespace ams::util {
template<typename T, size_t Size = sizeof(T), size_t Align = alignof(T)>
struct TypedStorage {
typename std::aligned_storage<Size, Align>::type _storage;
alignas(Align) std::byte _storage[Size];
};
template<typename T>

View file

@ -61,7 +61,7 @@ CFLAGS := -g -Wall -O2 -ffunction-sections \
CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -std=gnu++20 -fno-exceptions -fno-rtti
CXXFLAGS := $(CFLAGS) -std=gnu++23 -fno-exceptions -fno-rtti
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)

View file

@ -61,7 +61,7 @@ CFLAGS := -g -Wall -O2 -ffunction-sections \
CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++20
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++23
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)