From df38723d2d6a9bc8a2c839449500c73dcc568933 Mon Sep 17 00:00:00 2001 From: Mis012 Date: Mon, 30 Jun 2025 21:32:20 +0200 Subject: [PATCH] api-impl-jni: native_window.c: fix xr_func prototype for c23/gcc15, and add a warning on the limitations of __builtin_va_arg_pack --- src/libandroid/native_window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libandroid/native_window.c b/src/libandroid/native_window.c index 56895e14..220afdb3 100644 --- a/src/libandroid/native_window.c +++ b/src/libandroid/native_window.c @@ -664,9 +664,11 @@ PFN_vkVoidFunction bionic_vkGetInstanceProcAddr(VkInstance instance, const char // FIXME 2: this BLATANTLY belongs elsewhere -typedef XrResult(*xr_func)(); +typedef XrResult(*xr_func)(...); -// avoid hard dependency on libopenxr_loader for the three functions that we only ever call when running a VR app +/* avoid hard dependency on libopenxr_loader for the three functions that we only ever call when running a VR app */ +/* NOTE: our use of __builtin_va_arg_pack means this only works as long as we don't need to call a function + * that takes an integer type shorter than int or a floating point type shorter than double */ static void *openxr_loader_handle = NULL; static inline __attribute__((__always_inline__)) XrResult xr_lazy_call(char *func_name, ...) { if(!openxr_loader_handle) {