diff options
Diffstat (limited to 'src/core/hle/ipc_helpers.h')
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index cf204f570..026257115 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -404,6 +404,11 @@ inline s32 RequestParser::Pop() { | |||
| 404 | return static_cast<s32>(Pop<u32>()); | 404 | return static_cast<s32>(Pop<u32>()); |
| 405 | } | 405 | } |
| 406 | 406 | ||
| 407 | // Ignore the -Wclass-memaccess warning on memcpy for non-trivially default constructible objects. | ||
| 408 | #if defined(__GNUC__) | ||
| 409 | #pragma GCC diagnostic push | ||
| 410 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | ||
| 411 | #endif | ||
| 407 | template <typename T> | 412 | template <typename T> |
| 408 | void RequestParser::PopRaw(T& value) { | 413 | void RequestParser::PopRaw(T& value) { |
| 409 | static_assert(std::is_trivially_copyable_v<T>, | 414 | static_assert(std::is_trivially_copyable_v<T>, |
| @@ -411,6 +416,9 @@ void RequestParser::PopRaw(T& value) { | |||
| 411 | std::memcpy(&value, cmdbuf + index, sizeof(T)); | 416 | std::memcpy(&value, cmdbuf + index, sizeof(T)); |
| 412 | index += (sizeof(T) + 3) / 4; // round up to word length | 417 | index += (sizeof(T) + 3) / 4; // round up to word length |
| 413 | } | 418 | } |
| 419 | #if defined(__GNUC__) | ||
| 420 | #pragma GCC diagnostic pop | ||
| 421 | #endif | ||
| 414 | 422 | ||
| 415 | template <typename T> | 423 | template <typename T> |
| 416 | T RequestParser::PopRaw() { | 424 | T RequestParser::PopRaw() { |