mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-20 23:50:46 +01:00
[orbis-config.hpp] Add integral zero/sign extension specailization for uwrite
This commit is contained in:
parent
2a9d98c848
commit
3dbf146fbd
|
|
@ -5,6 +5,7 @@
|
|||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
#include <immintrin.h>
|
||||
#include <sys/ucontext.h>
|
||||
|
||||
|
|
@ -80,6 +81,12 @@ template <typename T> [[nodiscard]] ErrorCode uwrite(ptr<T> pointer, T data) {
|
|||
return uwriteRaw(pointer, &data, sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T, typename U> requires (std::is_arithmetic_v<T> && std::is_arithmetic_v<U> && sizeof(T) > sizeof(U) && !std::is_same_v<std::remove_cv_t<T>, bool>)
|
||||
[[nodiscard]] ErrorCode uwrite(ptr<T> pointer, U data) {
|
||||
T converted = data;
|
||||
return uwriteRaw(pointer, &converted, sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
[[nodiscard]] ErrorCode uread(T *result, ptr<T> pointer, std::size_t count) {
|
||||
return ureadRaw(&result, pointer, sizeof(T) * count);
|
||||
|
|
|
|||
Loading…
Reference in a new issue