From 62b99c9bd2395b9219aefd06e01f1082792a6ca6 Mon Sep 17 00:00:00 2001 From: pchome Date: Sat, 7 Apr 2018 15:01:13 +0300 Subject: [PATCH] [util] Fix compilation with WINE headers (#246) * [util] Define typeof keyword for WINE guiddef.h GCC: `-std options disable certain keywords` https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html MinGW: `#define __uuidof(type) __mingw_uuidof<__typeof(type)>()` WINE: `#define __uuidof(type) __wine_uuidof()` * [util] Fix compilation with WINE headers Overall definitions are the same but `__wine_` prefix used in . MinGW: _mingw.h + guiddef.h WINE: guiddef.h --- src/util/com/com_guid.h | 9 +++++++-- src/util/com/com_include.h | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/util/com/com_guid.h b/src/util/com/com_guid.h index efcfd93a8..d1f6b01d1 100644 --- a/src/util/com/com_guid.h +++ b/src/util/com/com_guid.h @@ -6,8 +6,13 @@ #include "com_include.h" #ifndef _MSC_VER -#define DXVK_DEFINE_GUID(iface) \ - template<> inline GUID const& __mingw_uuidof () { return iface::guid; } +# ifdef __WINE__ +# define DXVK_DEFINE_GUID(iface) \ + template<> inline GUID const& __wine_uuidof () { return iface::guid; } +# else +# define DXVK_DEFINE_GUID(iface) \ + template<> inline GUID const& __mingw_uuidof () { return iface::guid; } +# endif #endif std::ostream& operator << (std::ostream& os, REFIID guid); diff --git a/src/util/com/com_include.h b/src/util/com/com_include.h index 2ceeb2028..3c1193098 100644 --- a/src/util/com/com_include.h +++ b/src/util/com/com_include.h @@ -8,4 +8,10 @@ #define WIN32_LEAN_AND_MEAN #include -#include \ No newline at end of file +#include + +// GCC: -std options disable certain keywords +// https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html +#if defined(__WINE__) && !defined(typeof) +#define typeof __typeof +#endif