diff options
| author | 2021-01-31 00:51:16 -0800 | |
|---|---|---|
| committer | 2021-02-05 14:00:36 -0800 | |
| commit | 4577dcd5f90ae4e4e19a5ebdcec0f6f847977edf (patch) | |
| tree | f32d55fc1d82d0e2ecfa23db8e84ff69d0934adb | |
| parent | hle: kernel: Rename WritableEvent to KWritableEvent. (diff) | |
| download | yuzu-4577dcd5f90ae4e4e19a5ebdcec0f6f847977edf.tar.gz yuzu-4577dcd5f90ae4e4e19a5ebdcec0f6f847977edf.tar.xz yuzu-4577dcd5f90ae4e4e19a5ebdcec0f6f847977edf.zip | |
common: common_funcs: Add R_UNLESS_NOLOG for scenarios that should not log.
| -rw-r--r-- | src/common/common_funcs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 71b64e32a..cd3207a03 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -104,6 +104,14 @@ __declspec(dllimport) void __stdcall DebugBreak(void); | |||
| 104 | } \ | 104 | } \ |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | /// Evaluates a boolean expression, and returns a result unless that expression is true. | ||
| 108 | #define R_UNLESS_NOLOG(expr, res) \ | ||
| 109 | { \ | ||
| 110 | if (!(expr)) { \ | ||
| 111 | return res; \ | ||
| 112 | } \ | ||
| 113 | } | ||
| 114 | |||
| 107 | #define R_SUCCEEDED(res) (res.IsSuccess()) | 115 | #define R_SUCCEEDED(res) (res.IsSuccess()) |
| 108 | 116 | ||
| 109 | /// Evaluates an expression that returns a result, and returns the result if it would fail. | 117 | /// Evaluates an expression that returns a result, and returns the result if it would fail. |