4 ms·
*(void **)&vkCreateDebugReportCallbackEXT = vkGetInstanceProcAddr( ... ); Is there a cleaner/more idiomatic way to do this?
by aarongolliver 10y ago
*(void **)&vkCreateDebugReportCallbackEXT = vkGetInstanceProcAddr( ... );
Is there a cleaner/more idiomatic way to do this?
- jra101 10y agoPFN_vkCreateDebugReportCallbackEXT dbgCreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT");
- ucs 10y agoIs there a cleaner/more idiomatic way to do this? I'm afraid this is the C idiom for assigning a void pointer to a function pointer: *(void **) &fptr = getvoidptr(); Without the silly cast you'd get the following warning when compiling with -Wpedantic: warning: ISO C forbids assignment between function pointer and 'void *' Once you learn the idiom, and the reason behind it, it makes things (slightly) easier to parse than dealing with a bunch of typedefs, IMHO.