[PATCH 1/1] include/guiddef.h: use Mingw64's __uuidof when present
Eric Pouech
wine at gitlab.winehq.org
Mon May 2 11:07:14 CDT 2022
From: Eric Pouech <eric.pouech at gmail.com>
otherwise Wine's and Mingw64's __uuidof() enter in conflict (C++)
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
---
include/guiddef.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/guiddef.h b/include/guiddef.h
index 912fcea0cbe..5c8a1ab8a72 100644
--- a/include/guiddef.h
+++ b/include/guiddef.h
@@ -44,7 +44,11 @@ typedef struct _GUID
/* Macros for __uuidof emulation */
#ifdef __cplusplus
# if defined(__MINGW32__)
-# define __WINE_UUID_ATTR __attribute__((selectany))
+/* Mingw64 can provide support for __uuidof and __CRT_UUID_DECL... use Mingw64's when present */
+# if !defined(__uuidof)
+# define __WINE_UUID_ATTR __attribute__((selectany))
+# undef __CRT_UUID_DECL
+# endif
# elif defined(__GNUC__)
# define __WINE_UUID_ATTR __attribute__((visibility("hidden"),weak))
# endif
@@ -76,7 +80,7 @@ extern "C++" {
#define __uuidof(type) __wine_uuidof_type<__typeof__(type)>::inst::uuid
-#else /* __WINE_UUID_ATTR */
+#elif !defined(__CRT_UUID_DECL) /* __WINE_UUID_ATTR */
#define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/21
More information about the wine-devel
mailing list