From bec7188333a87a0cfad1eea9c06e1b9e96255e47 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 18 Sep 2024 23:08:25 +0200 Subject: [PATCH] vkd3d-utils: Make D3D12CreateDevice a variadic macro, if possible. Mostly to make life easier for (external) code invoking this with IID_PPV_ARGS or similar constructions. --- include/vkd3d_utils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index 4814fc6e..68508b60 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -58,7 +58,11 @@ VKD3D_UTILS_API HRESULT vkd3d_signal_event(HANDLE event); VKD3D_UTILS_API unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds); VKD3D_UTILS_API void vkd3d_destroy_event(HANDLE event); -#define D3D12CreateDevice(a, b, c, d) D3D12CreateDeviceVKD3D(a, b, c, d, VKD3D_UTILS_API_VERSION) +#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L +# define D3D12CreateDevice(...) D3D12CreateDeviceVKD3D(__VA_ARGS__, VKD3D_UTILS_API_VERSION) +#else +# define D3D12CreateDevice(a, b, c, d) D3D12CreateDeviceVKD3D(a, b, c, d, VKD3D_UTILS_API_VERSION) +#endif VKD3D_UTILS_API HRESULT WINAPI D3D12CreateRootSignatureDeserializer( const void *data, SIZE_T data_size, REFIID iid, void **deserializer); VKD3D_UTILS_API HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug);