summaryrefslogtreecommitdiffstats
path: root/modules/openxr/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openxr/util.h')
-rw-r--r--modules/openxr/util.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/openxr/util.h b/modules/openxr/util.h
index 7488b5cf8e..4c611d6f4a 100644
--- a/modules/openxr/util.h
+++ b/modules/openxr/util.h
@@ -34,21 +34,23 @@
#define UNPACK(...) __VA_ARGS__
#define INIT_XR_FUNC_V(openxr_api, name) \
- do { \
+ if constexpr (true) { \
XrResult get_instance_proc_addr_result; \
get_instance_proc_addr_result = openxr_api->get_instance_proc_addr(#name, (PFN_xrVoidFunction *)&name##_ptr); \
ERR_FAIL_COND_V(XR_FAILED(get_instance_proc_addr_result), false); \
- } while (0)
+ } else \
+ ((void)0)
#define EXT_INIT_XR_FUNC_V(name) INIT_XR_FUNC_V(OpenXRAPI::get_singleton(), name)
#define OPENXR_API_INIT_XR_FUNC_V(name) INIT_XR_FUNC_V(this, name)
#define INIT_XR_FUNC(openxr_api, name) \
- do { \
+ if constexpr (true) { \
XrResult get_instance_proc_addr_result; \
get_instance_proc_addr_result = openxr_api->get_instance_proc_addr(#name, (PFN_xrVoidFunction *)&name##_ptr); \
ERR_FAIL_COND(XR_FAILED(get_instance_proc_addr_result)); \
- } while (0)
+ } else \
+ ((void)0)
#define EXT_INIT_XR_FUNC(name) INIT_XR_FUNC(OpenXRAPI::get_singleton(), name)
#define OPENXR_API_INIT_XR_FUNC(name) INIT_XR_FUNC(this, name)
@@ -59,16 +61,18 @@
#define EXT_TRY_INIT_XR_FUNC(name) TRY_INIT_XR_FUNC(OpenXRAPI::get_singleton(), name)
#define OPENXR_TRY_API_INIT_XR_FUNC(name) TRY_INIT_XR_FUNC(this, name)
#define GDEXTENSION_INIT_XR_FUNC(name) \
- do { \
+ if constexpr (true) { \
name##_ptr = reinterpret_cast<PFN_##name>(get_openxr_api()->get_instance_proc_addr(#name)); \
ERR_FAIL_NULL(name##_ptr); \
- } while (0)
+ } else \
+ ((void)0)
#define GDEXTENSION_INIT_XR_FUNC_V(name) \
- do { \
+ if constexpr (true) { \
name##_ptr = reinterpret_cast<PFN_##name>(get_openxr_api()->get_instance_proc_addr(#name)); \
ERR_FAIL_NULL_V(name##_ptr, false); \
- } while (0)
+ } else \
+ ((void)0)
#define EXT_PROTO_XRRESULT_FUNC1(func_name, arg1_type, arg1) \
PFN_##func_name func_name##_ptr = nullptr; \