mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 08:29:44 -04:00
ams: support building unit test programs on windows/linux/macos
This commit is contained in:
parent
9a38be201a
commit
64a97576d0
756 changed files with 33359 additions and 9372 deletions
|
@ -31,10 +31,18 @@ namespace ams::fssystem {
|
|||
template<typename T, size_t Size>
|
||||
class Pimpl {
|
||||
private:
|
||||
alignas(0x10) u8 m_storage[Size];
|
||||
#if defined(ATMOSPHERE_OS_HORIZON) || defined(ATMOSPHERE_OS_WINDOWS) || defined(ATMOSPHERE_OS_LINUX)
|
||||
static constexpr size_t ExtraSizeToEnsureCompatibility = 0;
|
||||
#elif defined(ATMOSPHERE_OS_MACOS)
|
||||
static constexpr size_t ExtraSizeToEnsureCompatibility = 0x20;
|
||||
#endif
|
||||
|
||||
static constexpr size_t StorageSize = Size + ExtraSizeToEnsureCompatibility;
|
||||
private:
|
||||
alignas(0x10) u8 m_storage[StorageSize];
|
||||
public:
|
||||
ALWAYS_INLINE Pimpl() { impl::PimplHelper<T, Size>::Construct(m_storage); }
|
||||
ALWAYS_INLINE ~Pimpl() { impl::PimplHelper<T, Size>::Destroy(m_storage); }
|
||||
ALWAYS_INLINE Pimpl() { impl::PimplHelper<T, StorageSize>::Construct(m_storage); }
|
||||
ALWAYS_INLINE ~Pimpl() { impl::PimplHelper<T, StorageSize>::Destroy(m_storage); }
|
||||
|
||||
ALWAYS_INLINE T *Get() { return reinterpret_cast<T *>(m_storage + 0); }
|
||||
ALWAYS_INLINE T *operator->() { return reinterpret_cast<T *>(m_storage + 0); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue