mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
fix for egcs 1.0.x multiple inheritance bug
This commit is contained in:
parent
ed45005c40
commit
18358985ef
@ -23,6 +23,11 @@
|
||||
#include "prprf.h"
|
||||
#include "nsIRDFResourceFactory.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);
|
||||
|
||||
nsMsgLocalMailFolder::nsMsgLocalMailFolder(const char* uri)
|
||||
:nsMsgFolder(uri)
|
||||
{
|
||||
@ -46,7 +51,7 @@ nsMsgLocalMailFolder::QueryInterface(REFNSIID iid, void** result)
|
||||
|
||||
*result = nsnull;
|
||||
if (iid.Equals(nsIMsgLocalMailFolder::IID()) ||
|
||||
iid.Equals(::nsISupports::IID()))
|
||||
iid.Equals(kISupportsIID))
|
||||
{
|
||||
*result = NS_STATIC_CAST(nsIMsgLocalMailFolder*, this);
|
||||
AddRef();
|
||||
@ -364,7 +369,8 @@ nsMsgLocalMailFolder::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;
|
||||
|
||||
|
@ -39,7 +39,7 @@ static const char * kUnreadPendingMessagesColumnName = "unreadPendingMsgs";
|
||||
static const char * kMailboxNameColumnName = "mailboxName";
|
||||
|
||||
nsDBFolderInfo::nsDBFolderInfo(nsMsgDatabase *mdb)
|
||||
: m_folderDate() // now
|
||||
: m_folderDate(0) // now
|
||||
{
|
||||
m_mdbTable = NULL;
|
||||
m_mdbRow = NULL;
|
||||
|
@ -40,6 +40,12 @@
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID);
|
||||
|
||||
// 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);
|
||||
static NS_DEFINE_IID(kIRDFCursorIID, NS_IRDFCURSOR_IID);
|
||||
|
||||
nsIRDFResource* nsMSGFolderDataSource::kNC_Child;
|
||||
nsIRDFResource* nsMSGFolderDataSource::kNC_Folder;
|
||||
nsIRDFResource* nsMSGFolderDataSource::kNC_Name;
|
||||
@ -768,8 +774,8 @@ ArrayMsgFolderCursor::QueryInterface(REFNSIID iid, void** result)
|
||||
|
||||
*result = nsnull;
|
||||
if (iid.Equals(nsIRDFAssertionCursor::IID()) ||
|
||||
iid.Equals(::nsIRDFCursor::IID()) ||
|
||||
iid.Equals(::nsISupports::IID())) {
|
||||
iid.Equals(kIRDFCursorIID) ||
|
||||
iid.Equals(kISupportsIID)) {
|
||||
*result = NS_STATIC_CAST(nsIRDFAssertionCursor*, this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
@ -34,6 +34,11 @@
|
||||
#include "prprf.h"
|
||||
#include "nsCRT.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);
|
||||
|
||||
nsMailboxUrl::nsMailboxUrl(nsISupports* aContainer, nsIURLGroup* aGroup)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
@ -88,7 +93,8 @@ nsresult nsMailboxUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(nsIMailboxUrl::IID()) || aIID.Equals(::nsISupports::IID())) {
|
||||
if (aIID.Equals(nsIMailboxUrl::IID()) ||
|
||||
aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*) ((nsIMailboxUrl*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
@ -33,6 +33,12 @@
|
||||
#include "prprf.h"
|
||||
#include "nsCRT.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);
|
||||
|
||||
|
||||
nsPop3URL::nsPop3URL(nsISupports* aContainer, nsIURLGroup* aGroup)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
@ -86,7 +92,8 @@ nsresult nsPop3URL::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(nsIPop3URL::IID()) || aIID.Equals(::nsISupports::IID())) {
|
||||
if (aIID.Equals(nsIPop3URL::IID()) ||
|
||||
aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*) ((nsIPop3URL*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
|
@ -33,6 +33,11 @@
|
||||
#include "prprf.h"
|
||||
#include "nsCRT.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);
|
||||
|
||||
nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
@ -95,7 +100,8 @@ nsresult nsNntpUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (aIID.Equals(nsINntpUrl::IID()) || aIID.Equals(::nsISupports::IID())) {
|
||||
if (aIID.Equals(nsINntpUrl::IID()) ||
|
||||
aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = (void*) ((nsINntpUrl*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user