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 export ATMOSPHERE_CFLAGS += -Wno-c99-designator -Wno-gnu-alignof-expression -Wno-unused-private-field
endif 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 := export ATMOSPHERE_ASFLAGS :=

View File

@ -73,7 +73,7 @@ namespace ams::emummc {
/* Retrieve and cache values. */ /* 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 { struct {
char file_path[MaxDirLen + 1]; char file_path[MaxDirLen + 1];

View File

@ -23,8 +23,8 @@ namespace ams::fs {
#if defined(ATMOSPHERE_OS_HORIZON) #if defined(ATMOSPHERE_OS_HORIZON)
namespace { namespace {
constinit std::aligned_storage_t<0x80> g_fsp_service_object_buffer; alignas(0x10) constinit std::byte g_fsp_service_object_buffer[0x80] = {};
constinit std::aligned_storage_t<0x80> g_fsp_ldr_service_object_buffer; 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_service_object_buffer = false;
constinit bool g_use_static_fsp_ldr_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 { 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> template<typename T>
class StaticAllocatorForProgramInfoForInitialProcess : public std::allocator<T> { class StaticAllocatorForProgramInfoForInitialProcess : public std::allocator<T> {

View File

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

View File

@ -19,9 +19,13 @@
namespace ams::osdbg::impl { namespace ams::osdbg::impl {
template<size_t Size, int NumPointers, size_t Alignment> 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> 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)> template<typename T, size_t Size = sizeof(T), size_t Align = alignof(T)>
struct TypedStorage { struct TypedStorage {
typename std::aligned_storage<Size, Align>::type _storage; alignas(Align) std::byte _storage[Size];
}; };
template<typename T> template<typename T>

View File

@ -61,7 +61,7 @@ CFLAGS := -g -Wall -O2 -ffunction-sections \
CFLAGS += $(INCLUDE) -D__SWITCH__ 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) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) 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__ 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) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)