The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: adds variants of OXR_CHECK_XRET macro

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2604>

+20
+20
src/xrt/state_trackers/oxr/oxr_xret.h
··· 30 30 return oxr_error(LOG, XR_ERROR_RUNTIME_FAILURE, "Call to " #FUNCTION " failed"); \ 31 31 } \ 32 32 } while (false) 33 + 34 + #define OXR_CHECK_XRET_ALWAYS_RET(LOG, SESS, RESULTS, FUNCTION) \ 35 + do { \ 36 + OXR_CHECK_XRET(LOG, SESS, RESULTS, FUNCTION); \ 37 + return XR_SUCCESS; \ 38 + } while (false) 39 + 40 + #define OXR_CHECK_XRET_GOTO(LOG, SESS, RESULTS, FUNCTION, XR_RES, GOTO_LABEL) \ 41 + do { \ 42 + xrt_result_t check_ret = (RESULTS); \ 43 + if (check_ret == XRT_ERROR_IPC_FAILURE) { \ 44 + (SESS)->has_lost = true; \ 45 + XR_RES = oxr_error(LOG, XR_ERROR_INSTANCE_LOST, "Call to " #FUNCTION " failed"); \ 46 + goto GOTO_LABEL; \ 47 + } \ 48 + if (check_ret != XRT_SUCCESS) { \ 49 + XR_RES = oxr_error(LOG, XR_ERROR_RUNTIME_FAILURE, "Call to " #FUNCTION " failed"); \ 50 + goto GOTO_LABEL; \ 51 + } \ 52 + } while (false)