diff --git a/include/guiddef.h b/include/guiddef.h index f0799830f88..ba8e8cf4c2c 100644 --- a/include/guiddef.h +++ b/include/guiddef.h @@ -29,6 +29,32 @@ typedef struct _GUID unsigned short Data3; unsigned char Data4[ 8 ]; } GUID; + +/* Macros for __uuidof emulation */ +#if defined(__cplusplus) && !defined(_MSC_VER) + +extern "C++" { + template const GUID &__wine_uuidof(); +} + +#define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + extern "C++" { \ + template<> inline const GUID &__wine_uuidof() { \ + return (const IID){l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \ + } \ + template<> inline const GUID &__wine_uuidof() { \ + return __wine_uuidof(); \ + } \ + } + +#define __uuidof(type) __wine_uuidof() + +#else + +#define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#endif + #endif #undef DEFINE_GUID