Fix multiple definition error when using clang on Windows

This commit is contained in:
Maarten Bent 2018-08-16 20:11:12 +02:00
parent fd81223a2f
commit 8d72f3c5f4

View File

@ -73,12 +73,15 @@ struct IShellItem : public IUnknown
#endif // #ifndef __IShellItem_INTERFACE_DEFINED__ #endif // #ifndef __IShellItem_INTERFACE_DEFINED__
#if defined(__VISUALC__) || !defined(__IShellItem_INTERFACE_DEFINED__)
// Define this GUID in any case, even when __IShellItem_INTERFACE_DEFINED__ is // Define this GUID in any case, even when __IShellItem_INTERFACE_DEFINED__ is
// defined in the headers we might still not have it in the actual uuid.lib, // defined in the headers we might still not have it in the actual uuid.lib,
// this happens with at least VC7 used with its original (i.e. not updated) SDK // this happens with at least VC7 used with its original (i.e. not updated) SDK.
// and there is no harm in defining the GUID unconditionally. // clang complains about multiple definitions, so only define it unconditionally
// when using a Visual C compiler.
DEFINE_GUID(IID_IShellItem, DEFINE_GUID(IID_IShellItem,
0x43826D1E, 0xE718, 0x42EE, 0xBC, 0x55, 0xA1, 0xE2, 0x61, 0xC3, 0x7B, 0xFE); 0x43826D1E, 0xE718, 0x42EE, 0xBC, 0x55, 0xA1, 0xE2, 0x61, 0xC3, 0x7B, 0xFE);
#endif
struct IShellItemFilter; struct IShellItemFilter;
struct IFileDialogEvents; struct IFileDialogEvents;