I'm trying to write Vulkan function wrapper macro that "generates" a typename of the style PFN_vkCurrentFunction automatically.
Pseudo-code example (doesn't compile):
#define CALL(...) \
PFN_##__func__ functionPtr \
= (PFN_##__func__) GetProcAddress(__func__); \
functionPtr( __VA_ARGS__ );
VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance)
{
CALL( pCreateInfo, pAllocator, pInstance );
}
The PFN_##__func__ part of this macro is invalid and will not compile.