fix for egcs compiler bugs

This commit is contained in:
alecf%netscape.com 1999-02-16 23:10:46 +00:00
parent 0d887186ab
commit 1c8af60f39
2 changed files with 18 additions and 5 deletions

View File

@ -27,6 +27,11 @@
#include "nsMsgDatabase.h"
#endif
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::IID() inside of a class
// that multiply inherits from nsISupports
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsMsgFolder::nsMsgFolder(const char* uri)
: nsRDFResource(PL_strdup(uri))
{
@ -89,7 +94,7 @@ nsMsgFolder::QueryInterface(REFNSIID iid, void** result)
*result = nsnull;
if(iid.Equals(nsIMsgFolder::IID()) ||
iid.Equals(::nsISupports::IID())) {
iid.Equals(kISupportsIID)) {
*result = NS_STATIC_CAST(nsIMsgFolder*, this);
AddRef();
return NS_OK;
@ -447,7 +452,8 @@ NS_IMETHODIMP nsMsgFolder::AddSubFolder(const nsIMsgFolder *folder)
{
nsISupports * supports;
if(NS_SUCCEEDED(((nsISupports*)folder)->QueryInterface(::nsISupports::IID(), (void**)&supports)))
if(NS_SUCCEEDED(((nsISupports*)folder)->QueryInterface(kISupportsIID,
(void**)&supports)))
{
mSubFolders->AppendElement(supports);
NS_RELEASE(supports);
@ -469,7 +475,8 @@ NS_IMETHODIMP nsMsgFolder::RemoveSubFolder (const nsIMsgFolder *which)
{
nsISupports * supports;
if(NS_SUCCEEDED(((nsISupports*)which)->QueryInterface(::nsISupports::IID(), (void**)&supports)))
if(NS_SUCCEEDED(((nsISupports*)which)->QueryInterface(kISupportsIID,
(void**)&supports)))
{
mSubFolders->RemoveElement(supports, 0);
//make sure it's really been removed and no others exist.

View File

@ -22,6 +22,11 @@
#include "nsMsgFolderFlags.h"
#include "prprf.h"
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::IID() inside of a class
// that multiply inherits from nsISupports
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
nsMsgImapMailFolder::nsMsgImapMailFolder(const char* uri)
:nsMsgFolder(uri)
{
@ -44,7 +49,7 @@ nsMsgImapMailFolder::QueryInterface(REFNSIID iid, void** result)
*result = nsnull;
if (iid.Equals(nsIMsgImapMailFolder::IID()) ||
iid.Equals(::nsISupports::IID()))
iid.Equals(kISupportsIID))
{
*result = NS_STATIC_CAST(nsIMsgImapMailFolder*, this);
AddRef();
@ -108,7 +113,8 @@ nsMsgImapMailFolder::FindChildNamed(const char *name, nsIMsgFolder ** aChild)
supports = mSubFolders->ElementAt(i);
if (folder)
NS_RELEASE(folder);
if (NS_SUCCEEDED(supports->QueryInterface(::nsISupports::IID(), (void**)&folder)))
if (NS_SUCCEEDED(supports->QueryInterface(kISupportsIID,
(void**)&folder)))
{
char *folderName;