Before: ```c++ #define INITGUID #include <unknwn.h> const GUID& a() { return __uuidof(IUnknown); } const GUID& b() { return IID_IUnknown; } ``` ``` $ clang -xc++ -target i386-pc-windows-gnu -nostdinc -I include -I include/msvcrt a.cpp -masm=intel -nostdlib a.cpp:3:26: warning: instantiation of variable '__wine_uuidof<IUnknown>::uuid' required here, but no definition is available [-Wundefined-var-template] [...] 1 warning generated. /usr/bin/ld: /tmp/a-7e5d2f.o:a.cpp:(.rdata$.refptr._IID_IUnknown+0x0): undefined reference to `IID_IUnknown' /usr/bin/ld: /tmp/a-7e5d2f.o:a.cpp:(.rdata$.refptr.__ZN13__wine_uuidofI8IUnknownE4uuidE+0x0): undefined reference to `__wine_uuidof<IUnknown>::uuid' clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` After: Creates an a.exe with no warnings. (With a() as entry point; figuring out how to give it a real entry point is offtopic to this MR.)
From: Alfred Agrell floating@muncher.se
--- include/unknwn.idl | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/unknwn.idl b/include/unknwn.idl index 0798ccf79ab..7c4a8f02015 100644 --- a/include/unknwn.idl +++ b/include/unknwn.idl @@ -60,6 +60,9 @@ cpp_quote(" }") cpp_quote(" END_INTERFACE") cpp_quote(" };") cpp_quote("}") +cpp_quote("#ifdef __CRT_UUID_DECL") +cpp_quote("__CRT_UUID_DECL(IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46)") +cpp_quote("#endif") cpp_quote("#else") HRESULT QueryInterface( [in] REFIID riid,