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

This commit is contained in:
Mis012
2025-06-30 21:32:20 +02:00
parent 2a0c6cd455
commit df38723d2d

View File

@@ -664,9 +664,11 @@ PFN_vkVoidFunction bionic_vkGetInstanceProcAddr(VkInstance instance, const char
// FIXME 2: this BLATANTLY belongs elsewhere // 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 void *openxr_loader_handle = NULL;
static inline __attribute__((__always_inline__)) XrResult xr_lazy_call(char *func_name, ...) { static inline __attribute__((__always_inline__)) XrResult xr_lazy_call(char *func_name, ...) {
if(!openxr_loader_handle) { if(!openxr_loader_handle) {