Eric Pouech : include: Use Mingw64's __uuidof when present.

Alexandre Julliard julliard at winehq.org
Thu May 19 16:15:12 CDT 2022


Module: wine
Branch: master
Commit: 4a1f1082e47ac0fddd6d4925636a557a593f3801
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4a1f1082e47ac0fddd6d4925636a557a593f3801

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Mon May  2 18:05:30 2022 +0200

include: Use Mingw64's __uuidof when present.

otherwise Wine's and Mingw64's __uuidof() conflict (C++)

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/guiddef.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/guiddef.h b/include/guiddef.h
index 912fcea0cbe..6f7e26df0c6 100644
--- a/include/guiddef.h
+++ b/include/guiddef.h
@@ -44,7 +44,10 @@ typedef struct _GUID
 /* Macros for __uuidof emulation */
 #ifdef __cplusplus
 # if defined(__MINGW32__)
-#  define __WINE_UUID_ATTR __attribute__((selectany))
+#  if !defined(__uuidof)  /* Mingw64 can provide support for __uuidof and __CRT_UUID_DECL */
+#   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 +79,7 @@ extern "C++" {
 
 #define __uuidof(type) __wine_uuidof_type<__typeof__(type)>::inst::uuid
 
-#else /* __WINE_UUID_ATTR */
+#elif !defined(__CRT_UUID_DECL)
 
 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
 




More information about the wine-cvs mailing list