From 5b135d12ca574c8493cd88c9405ad860d040e4a2 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 5 Jun 2024 11:28:29 -0700 Subject: [PATCH] libstrat: fix more gnu++23 errors --- .../libstratosphere/include/stratosphere/sf/sf_buffers.hpp | 2 +- .../include/stratosphere/sf/sf_default_allocation_policy.hpp | 2 +- .../include/stratosphere/sf/sf_exp_heap_allocator.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp index 32286f48f..bc134fd91 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp @@ -42,7 +42,7 @@ namespace ams::sf { } else if constexpr(TransferMode == BufferTransferMode::AutoSelect) { return SfBufferAttr_HipcAutoSelect; } else { - static_assert(TransferMode != TransferMode, "Invalid BufferTransferMode"); + static_assert(false, "Invalid BufferTransferMode"); } }(); diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp index 64a491eb0..56ca7f5a7 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp @@ -29,7 +29,7 @@ namespace ams::sf { private: struct Holder { MemoryResource *allocator; - typename std::aligned_storage::type storage; + alignas(alignof(T)) std::byte storage[sizeof(T)]; }; public: void *Allocate(size_t size) { diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp index 5a30b09ee..6ec6fcdca 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp @@ -57,7 +57,7 @@ namespace ams::sf { struct Globals { ExpHeapAllocator allocator; - typename std::aligned_storage::type buffer; + alignas(0x10) std::byte buffer[Size == 0 ? 1 : Size]; }; static constinit inline Globals _globals = {};