mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 11:48:36 +12:00
Added .aligned() method for vm::ptr
Added set_alignment() macro for setting alignment Added alignof32() macro similar to sizeof32() Added CHECK_SIZE, CHECK_ALIGN macro with static_assert Minor refactoring
This commit is contained in:
parent
a7f77c27f7
commit
e896da8064
18 changed files with 1202 additions and 1237 deletions
|
@ -388,7 +388,7 @@ union u128
|
|||
}
|
||||
};
|
||||
|
||||
static_assert(__alignof(u128) == 16 && sizeof(u128) == 16, "Wrong u128 size or alignment");
|
||||
CHECK_SIZE_ALIGN(u128, 16, 16);
|
||||
|
||||
static force_inline u128 sync_val_compare_and_swap(volatile u128* dest, u128 comp, u128 exch)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
#define force_inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define set_alignment(x) _CRT_ALIGN(x)
|
||||
#else
|
||||
#define set_alignment(x) __attribute__((aligned(x)))
|
||||
#endif
|
||||
|
||||
template<size_t size>
|
||||
void strcpy_trunc(char(&dst)[size], const std::string& src)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue