fix WeakReference exporting for Windows. a:chofmann r:scc.

This commit is contained in:
danm%netscape.com 1999-08-11 23:48:08 +00:00
Родитель 1af9ed60fe
Коммит 4b3daedbe5
6 изменённых файлов: 22 добавлений и 21 удалений

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

@ -19,7 +19,8 @@ interface nsISupportsWeakReference : nsISupports
// typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;
// ...this definition had to be moved to nsWeakPtr.h to avoid circular includes, sorry
nsIWeakReference* NS_GetWeakReference( nsISupports* , nsresult* aResult = 0);
extern NS_COM nsIWeakReference*
NS_GetWeakReference( nsISupports* , nsresult* aResult = 0);
// ...convenience. Get a weak reference (if possible) without doing the query yourself
template <class T>

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

@ -3,7 +3,7 @@
#include "nsWeakReference.h"
#include "nsCOMPtr.h"
nsIWeakReference*
NS_COM nsIWeakReference *
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
{
nsresult status;
@ -18,7 +18,7 @@ NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
return weakP;
}
nsresult
NS_IMETHODIMP
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
{
if ( !aInstancePtr )
@ -40,13 +40,13 @@ nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
return status;
}
nsrefcnt
NS_IMETHODIMP_(nsrefcnt)
nsWeakReference::AddRef()
{
return ++mRefCount;
}
nsrefcnt
NS_IMETHODIMP_(nsrefcnt)
nsWeakReference::Release()
{
nsrefcnt temp = --mRefCount;
@ -55,7 +55,7 @@ nsWeakReference::Release()
return temp;
}
nsresult
NS_IMETHODIMP
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
{
if ( !aInstancePtr )
@ -80,7 +80,7 @@ nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
return status;
}
nsresult
NS_IMETHODIMP
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
{
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;

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

@ -5,7 +5,7 @@
#include "nsIWeakReference.h"
class nsSupportsWeakReference : public nsISupportsWeakReference
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
{
public:
nsSupportsWeakReference()
@ -31,7 +31,7 @@ class nsSupportsWeakReference : public nsISupportsWeakReference
nsWeakReference* mProxy;
};
class nsWeakReference : public nsIWeakReference
class NS_COM nsWeakReference : public nsIWeakReference
{
public:
// nsISupports...
@ -72,8 +72,7 @@ class nsWeakReference : public nsIWeakReference
nsSupportsWeakReference* mReferent;
};
inline
nsSupportsWeakReference::~nsSupportsWeakReference()
inline nsSupportsWeakReference::~nsSupportsWeakReference()
{
if ( mProxy )
mProxy->NoticeReferentDestruction();

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

@ -45,6 +45,7 @@
#include "nsAVLTree.h"
#include "nsHashtableEnumerator.h"
#include "nsPipe2.h"
#include "nsWeakReference.h"
class dummyComparitor: public nsAVLNodeComparitor {
public:
@ -99,6 +100,7 @@ void XXXNeverCalled()
XPTI_GetInterfaceInfoManager();
NS_NewGenericFactory(NULL, NULL, NULL);
NS_NewHashtableEnumerator(NULL, NULL, NULL, NULL);
NS_GetWeakReference(NULL);
#ifdef DEBUG
TestSegmentedBuffer();
#endif

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

@ -3,7 +3,7 @@
#include "nsWeakReference.h"
#include "nsCOMPtr.h"
nsIWeakReference*
NS_COM nsIWeakReference *
NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
{
nsresult status;
@ -18,7 +18,7 @@ NS_GetWeakReference( nsISupports* aInstance, nsresult* aResult )
return weakP;
}
nsresult
NS_IMETHODIMP
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
{
if ( !aInstancePtr )
@ -40,13 +40,13 @@ nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
return status;
}
nsrefcnt
NS_IMETHODIMP_(nsrefcnt)
nsWeakReference::AddRef()
{
return ++mRefCount;
}
nsrefcnt
NS_IMETHODIMP_(nsrefcnt)
nsWeakReference::Release()
{
nsrefcnt temp = --mRefCount;
@ -55,7 +55,7 @@ nsWeakReference::Release()
return temp;
}
nsresult
NS_IMETHODIMP
nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
{
if ( !aInstancePtr )
@ -80,7 +80,7 @@ nsWeakReference::QueryInterface( const nsIID& aIID, void** aInstancePtr )
return status;
}
nsresult
NS_IMETHODIMP
nsWeakReference::QueryReference( const nsIID& aIID, void** aInstancePtr )
{
return mReferent ? mReferent->QueryInterface(aIID, aInstancePtr) : NS_ERROR_NULL_POINTER;

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

@ -5,7 +5,7 @@
#include "nsIWeakReference.h"
class nsSupportsWeakReference : public nsISupportsWeakReference
class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference
{
public:
nsSupportsWeakReference()
@ -31,7 +31,7 @@ class nsSupportsWeakReference : public nsISupportsWeakReference
nsWeakReference* mProxy;
};
class nsWeakReference : public nsIWeakReference
class NS_COM nsWeakReference : public nsIWeakReference
{
public:
// nsISupports...
@ -72,8 +72,7 @@ class nsWeakReference : public nsIWeakReference
nsSupportsWeakReference* mReferent;
};
inline
nsSupportsWeakReference::~nsSupportsWeakReference()
inline nsSupportsWeakReference::~nsSupportsWeakReference()
{
if ( mProxy )
mProxy->NoticeReferentDestruction();