Implement GUID comparison method inilne rather than rely on ATLs constantly changing method. b=127982 r=chak@netscape.com sr=rpotts@netscape.com a=asa@mozilla.org

This commit is contained in:
locka%iol.ie 2002-03-19 22:28:50 +00:00
Родитель 40bf1930e8
Коммит e542c23fba
1 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -185,6 +185,19 @@ CMozillaBrowser::~CMozillaBrowser()
Terminate();
}
// See bug 127982:
//
// Microsoft's InlineIsEqualGUID global function is multiply defined
// in ATL and/or SDKs with varying namespace requirements. To save the control
// from future grief, this method is used instead.
static inline BOOL _IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
{
return (
((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] &&
((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] &&
((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] &&
((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]);
}
STDMETHODIMP CMozillaBrowser::InterfaceSupportsErrorInfo(REFIID riid)
{
@ -194,9 +207,9 @@ STDMETHODIMP CMozillaBrowser::InterfaceSupportsErrorInfo(REFIID riid)
&IID_IWebBrowser2,
&IID_IWebBrowserApp
};
for (int i=0;i<(sizeof(arr)/sizeof(arr[0]));i++)
for (int i = 0; i < (sizeof(arr) / sizeof(arr[0])); i++)
{
if (::ATL::InlineIsEqualGUID(*arr[i],riid))
if (_IsEqualGUID(*arr[i], riid))
return S_OK;
}
return S_FALSE;