From 3ebe7d5b9b4a102bd3f6595f155087ce5eab8c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 3 Apr 2018 11:49:14 +0200 Subject: [PATCH] include: Add emulation of __uuidof(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- include/vkd3d_windows.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/vkd3d_windows.h b/include/vkd3d_windows.h index 3b1f92a1..425d1396 100644 --- a/include/vkd3d_windows.h +++ b/include/vkd3d_windows.h @@ -122,6 +122,33 @@ typedef GUID IID; EXTERN_C const GUID name DECLSPEC_HIDDEN; # endif /* INITGUID */ +/* __uuidof emulation */ +#if defined(__cplusplus) && !defined(_MSC_VER) + +extern "C++" +{ + template const GUID &__vkd3d_uuidof(); +} + +# define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + extern "C++" \ + { \ + template<> inline const GUID &__vkd3d_uuidof() \ + { \ + static const IID __uuid_inst = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \ + return __uuid_inst; \ + } \ + template<> inline const GUID &__vkd3d_uuidof() \ + { \ + return __vkd3d_uuidof(); \ + } \ + } + +# define __uuidof(type) __vkd3d_uuidof() +#else +# define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) +#endif /* defined(__cplusplus) && !defined(_MSC_VER) */ + typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; #endif /* !defined(_WIN32) || defined(__WIDL__) */