Monado OpenXR Runtime
oxr_xret.h File Reference

File holding helper for xrt_result_t results. More...

#include "xrt/xrt_results.h"
#include "oxr_objects.h"
Include dependency graph for oxr_xret.h:

Go to the source code of this file.

Macros

#define OXR_CHECK_XRET(LOG, SESS, RESULTS, FUNCTION)
 Helper define to check results from 'xrt_` functions (xrt_result_t) and also set any needed state. More...
 
#define OXR_CHECK_XRET_ALWAYS_RET(LOG, SESS, RESULTS, FUNCTION)
 
#define OXR_CHECK_XRET_GOTO(LOG, SESS, RESULTS, FUNCTION, XR_RES, GOTO_LABEL)
 

Detailed Description

File holding helper for xrt_result_t results.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ OXR_CHECK_XRET_ALWAYS_RET

#define OXR_CHECK_XRET_ALWAYS_RET (   LOG,
  SESS,
  RESULTS,
  FUNCTION 
)
Value:
do { \
OXR_CHECK_XRET(LOG, SESS, RESULTS, FUNCTION); \
return XR_SUCCESS; \
} while (false)

◆ OXR_CHECK_XRET_GOTO

#define OXR_CHECK_XRET_GOTO (   LOG,
  SESS,
  RESULTS,
  FUNCTION,
  XR_RES,
  GOTO_LABEL 
)
Value:
do { \
xrt_result_t check_ret = (RESULTS); \
if (check_ret == XRT_ERROR_IPC_FAILURE) { \
(SESS)->has_lost = true; \
XR_RES = oxr_error(LOG, XR_ERROR_INSTANCE_LOST, "Call to " #FUNCTION " failed"); \
goto GOTO_LABEL; \
} \
if (check_ret != XRT_SUCCESS) { \
XR_RES = oxr_error(LOG, XR_ERROR_RUNTIME_FAILURE, "Call to " #FUNCTION " failed"); \
goto GOTO_LABEL; \
} \
} while (false)
@ XRT_SUCCESS
The operation succeeded.
Definition: xrt_results.h:27
@ XRT_ERROR_IPC_FAILURE
A problem occurred either with the IPC transport itself, with invalid commands from the client,...
Definition: xrt_results.h:50
XrResult oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt,...)
Definition: oxr_logger.c:203