From 6ced3011c05d36b46a3778a24b5de4fee2ce39fe Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Sun, 22 Aug 1999 22:55:47 +0000 Subject: [PATCH] Remove unnecessary windows.h include which was used to get InterlockedIncrement for threadsafe interfaces. I fixed the implementation of threadsafe addref and release for windows to not require it so people no longer need to include windows.h whenever you are using a threadsafe interface. return NS_ERROR_NOT_IMPLEMENTED for some of the channel interface implementations Use NS_GET_IID. git-svn-id: svn://10.0.0.236/trunk@44090 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/news/src/nsNntpService.cpp | 31 +++++++-------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/mozilla/mailnews/news/src/nsNntpService.cpp b/mozilla/mailnews/news/src/nsNntpService.cpp index 9bf5d07ae47..a7ebeec8c11 100644 --- a/mozilla/mailnews/news/src/nsNntpService.cpp +++ b/mozilla/mailnews/news/src/nsNntpService.cpp @@ -19,12 +19,6 @@ #include "msgCore.h" // precompiled header... #include "nntpCore.h" #include "nsMsgNewsCID.h" - -#ifdef XP_PC -#include // for InterlockedIncrement -#endif - -#include "nsNntpService.h" #include "nsINntpUrl.h" #include "nsNNTPProtocol.h" #include "nsNNTPNewsgroupPost.h" @@ -42,14 +36,12 @@ #include "nsINetSupportDialogService.h" #include "nsIPref.h" #include "nsCRT.h" // for nsCRT::strtok +#include "nsNntpService.h" +#undef GetPort // XXX Windows! +#undef SetPort // XXX Windows! #define PREF_NETWORK_HOSTS_NNTP_SERVER "network.hosts.nntp_server" -// we need this because of an egcs 1.0 (and possibly gcc) compiler bug -// that doesn't allow you to call ::nsISupports::GetIID() inside of a class -// that multiply inherits from nsISupports -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_CID(kCNntpUrlCID, NS_NNTPURL_CID); static NS_DEFINE_CID(kCNewsDB, NS_NEWSDB_CID); static NS_DEFINE_CID(kCNNTPNewsgroupCID, NS_NNTPNEWSGROUP_CID); @@ -75,20 +67,20 @@ nsresult nsNntpService::QueryInterface(const nsIID &aIID, void** aInstancePtr) if (nsnull == aInstancePtr) return NS_ERROR_NULL_POINTER; - if (aIID.Equals(nsINntpService::GetIID()) - || aIID.Equals(kISupportsIID)) + if (aIID.Equals(NS_GET_IID(nsINntpService)) + || aIID.Equals(NS_GET_IID(nsISupports)) ) { *aInstancePtr = (void*) ((nsINntpService*)this); NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(nsIMsgMessageService::GetIID())) + if (aIID.Equals(NS_GET_IID(nsIMsgMessageService))) { *aInstancePtr = (void*) ((nsIMsgMessageService*)this); NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(nsIProtocolHandler::GetIID())) + if (aIID.Equals(NS_GET_IID(nsIProtocolHandler))) { *aInstancePtr = (void *) ((nsIProtocolHandler*) this); NS_ADDREF_THIS(); @@ -842,16 +834,14 @@ NS_IMETHODIMP nsNntpService::GetDefaultPort(PRInt32 *aDefaultPort) NS_IMETHODIMP nsNntpService::MakeAbsolute(const char *aRelativeSpec, nsIURI *aBaseURI, char **_retval) { // no such thing as relative urls for smtp..... - NS_ASSERTION(0, "unimplemented"); - return NS_OK; + return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsNntpService::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI **_retval) { *_retval = nsnull; // i just haven't implemented this yet...I will be though.... - NS_ASSERTION(0, "unimplemented"); - return NS_ERROR_FAILURE; + return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsNntpService::NewChannel(const char *verb, nsIURI *aURI, nsIEventSinkGetter *eventSinkGetter, nsIChannel **_retval) @@ -860,6 +850,5 @@ NS_IMETHODIMP nsNntpService::NewChannel(const char *verb, nsIURI *aURI, nsIEvent // mscott - right now, I don't like the idea of returning channels to the caller. They just want us // to run the url, they don't want a channel back...I'm going to be addressing this issue with // the necko team in more detail later on. - NS_ASSERTION(0, "unimplemented"); - return NS_ERROR_FAILURE; + return NS_ERROR_NOT_IMPLEMENTED; }