Verified Commit 8ade6b65 authored by Simon Ser's avatar Simon Ser

xrt: introduce OXR_VERIFY_ARG_TYPE_CAN_BE_NULL

It's like OXR_VERIFY_ARG_TYPE_AND_NOT_NULL, but doesn't ensure the argument
is non-NULL.
parent 1b51db68
......@@ -112,16 +112,21 @@ extern "C" {
} \
} while (false)
#define OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(log, arg, type_enum) \
#define OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(log, arg, type_enum) \
do { \
if (arg == NULL) { \
if (arg != NULL && arg->type != type_enum) { \
return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, \
"(" #arg "== NULL)"); \
"(" #arg "->type == %u)", arg->type); \
} \
if (arg->type != type_enum) { \
} while (false)
#define OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(log, arg, type_enum) \
do { \
if (arg == NULL) { \
return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, \
"(" #arg "->type = %u)", arg->type); \
"(" #arg " == NULL)"); \
} \
OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(log, arg, type_enum); \
} while (false)
#define OXR_VERIFY_SUBACTION_PATHS(log, count, paths) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment