diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-07-20 14:49:13 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-07-20 15:00:58 -0400 |
| commit | 9e7e0ed9f00db333dca7ead90955d5e99679efc0 (patch) | |
| tree | 35e7886a5d09f822badff4efa4f617e214a57cee /src/core/hle/kernel/thread.cpp | |
| parent | b82c160eff33aabbe78ae271d6e60054fd103775 (diff) | |
ipc_helpers: Add PushEnum() member function to ResponseBuilder
Allows pushing strongly-typed enum members without the need to always
cast them at the call sites.
Note that we *only* allow strongly-typed enums in this case. The reason
for this is that strongly typed enums have a guaranteed defined size, so
the size of the data being pushed is always deterministic. With regular
enums this can be a little more error-prone, so we disallow them.
This function simply uses the underlying type of the enum to determine
the size of the data. For example, if an enum is defined as:
enum class SomeEnum : u16 {
SomeEntry
};
if PushEnum(SomeEnum::SomeEntry); is called, then it will push a
u16-size amount of data.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
0 files changed, 0 insertions, 0 deletions
