mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
st/oxr: Add OXR_VERIFY_API_VERSION_AT_LEAST verification macro
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
parent
ae7facbdc7
commit
bff72f6c23
|
@ -116,6 +116,23 @@ extern "C" {
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* A condition if the instance is created with at least a given OpenXR version
|
||||||
|
*/
|
||||||
|
#define OXR_API_VERSION_AT_LEAST(inst, major, minor) \
|
||||||
|
((inst)->openxr_version.major_minor >= XR_MAKE_VERSION(major, minor, 0))
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Checks if the instance is created with at least a given OpenXR version
|
||||||
|
*/
|
||||||
|
#define OXR_VERIFY_API_VERSION_AT_LEAST(log, inst, major, minor) \
|
||||||
|
do { \
|
||||||
|
if (!OXR_VERSION_AT_LEAST(inst, major, minor)) { \
|
||||||
|
return oxr_error((log), XR_ERROR_FUNCTION_UNSUPPORTED, "Requires OpenXR version %d.%d.x", \
|
||||||
|
major, minor); \
|
||||||
|
} \
|
||||||
|
} while (false)
|
||||||
|
|
||||||
#define OXR_VERIFY_ARG_NOT_NULL(log, arg) \
|
#define OXR_VERIFY_ARG_NOT_NULL(log, arg) \
|
||||||
do { \
|
do { \
|
||||||
if (arg == NULL) { \
|
if (arg == NULL) { \
|
||||||
|
|
Loading…
Reference in a new issue