r= warren@netscape.com
OS/2 changes for Mozilla - add #ifdef, change #ifdef


git-svn-id: svn://10.0.0.236/trunk@61869 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com
2000-02-29 15:40:42 +00:00
parent 1b28c52e4d
commit bc38f9abb8
7 changed files with 63 additions and 15 deletions

View File

@@ -41,7 +41,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
// Platform specific defines and includes
////////////////////////////////////////////////////////////////////////////////
// PC
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
#define WM_DNS_SHUTDOWN (WM_USER + 200)
#endif /* XP_PC */
@@ -110,7 +110,7 @@ protected:
nsInetHostInfo mInetHostInfo;
#endif
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
friend static LRESULT CALLBACK nsDNSEventProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
HANDLE mLookupHandle;
PRUint32 mMsgID;
@@ -163,7 +163,7 @@ nsDNSLookup::nsDNSLookup(nsISupports * clientContext, const char * hostName, nsI
PL_strcpy(mHostName, hostName);
mContext = clientContext;
mListener = listener;
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
mMsgID = 0;
#endif
@@ -288,7 +288,7 @@ nsDNSLookup::InitiateDNSLookup(void)
rv = NS_ERROR_UNEXPECTED;
#endif /* XP_MAC */
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
mMsgID = nsDNSService::gService->AllocMsgID();
if (mMsgID == 0)
return NS_ERROR_UNEXPECTED;
@@ -354,7 +354,7 @@ pascal void nsDnsServiceNotifierRoutine(void * contextPtr, OTEventCode code, OT
}
#endif /* XP_MAC */
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
static LRESULT CALLBACK
nsDNSEventProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -448,7 +448,7 @@ nsDNSService::nsDNSService()
#endif /* TARGET_CARBON */
#endif /* defined(XP_MAC) */
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
int i;
for (i=0; i<4; i++)
mMsgIDBitVector[i] = 0;
@@ -589,7 +589,7 @@ nsDNSService::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult)
nsresult
nsDNSService::InitDNSThread(void)
{
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
WNDCLASS wc;
char * windowClass = "Mozilla:DNSWindowClass";
@@ -624,7 +624,7 @@ nsDNSService::InitDNSThread(void)
}
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
PRUint32
nsDNSService::AllocMsgID(void)
@@ -676,7 +676,7 @@ nsDNSService::Run(void)
{
nsresult rv = NS_OK;
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
MSG msg;
InitDNSThread();
@@ -836,7 +836,7 @@ nsDNSService::Lookup(nsISupports* clientContext,
return NS_ERROR_OUT_OF_MEMORY;
}
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
// save on outstanding lookup queue
PR_Lock(mThreadLock);
mCompletionQueue.AppendElement(lookup);
@@ -848,7 +848,7 @@ nsDNSService::Lookup(nsISupports* clientContext,
// initiate async lookup
rv = lookup->InitiateDNSLookup();
if (rv != NS_OK) {
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
PR_Lock(mThreadLock);
mCompletionQueue.RemoveElement(lookup);
PR_Unlock(mThreadLock);
@@ -886,7 +886,7 @@ nsDNSService::Shutdown()
// mThread = nsnull;
}
#elif defined(XP_PC)
#elif defined(XP_PC) && !defined(XP_OS2)
SendMessage(mDNSWindow, WM_DNS_SHUTDOWN, 0, 0);
if (mThread) {
rv = mThread->Join();

View File

@@ -31,7 +31,7 @@
#include <OSUtils.h>
#include <OpenTransport.h>
#include <OpenTptInternet.h>
#elif defined (XP_PC)
#elif defined (XP_PC) && !defined(XP_OS2)
#include <windows.h>
#include <Winsock2.h>
#endif
@@ -89,7 +89,7 @@ protected:
#endif /* TARGET_CARBON */
#endif /* XP_MAC */
#if defined(XP_PC)
#if defined(XP_PC) && !defined(XP_OS2)
PRUint32 AllocMsgID(void);
void FreeMsgID(PRUint32 msgID);

View File

@@ -32,7 +32,7 @@
#include "prenv.h"
#include "nsSpecialSystemDirectory.h"
#ifdef XP_PC
#if defined (XP_PC) && !defined (XP_OS2)
#include <windows.h>
static HINSTANCE g_hInst = NULL;
#endif

View File

@@ -45,6 +45,10 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#ifdef WIN32
#include <windows.h>
#endif
#ifdef XP_OS2
#include <os2.h>
#endif
static int gKeepRunning = 0;
static nsIEventQueue* gEventQ = nsnull;
/////////////////////////////////
@@ -365,11 +369,20 @@ main(int argc, char* argv[])
#else
#ifdef XP_MAC
/* Mac stuff is missing here! */
#else
#ifdef XP_OS2
QMSG qmsg;
if (WinGetMsg(0, &qmsg, 0, 0, 0))
WinDispatchMsg(0, &qmsg);
else
gKeepRunning = FALSE;
#else
PLEvent *gEvent;
rv = gEventQ->GetEvent(&gEvent);
rv = gEventQ->HandleEvent(gEvent);
#endif /* XP_UNIX */
#endif /* XP_OS2 */
#endif /* !WIN32 */
}

View File

@@ -24,6 +24,9 @@
#ifdef WIN32
#include <windows.h>
#endif
#ifdef OS2
#include <os2.h>
#endif
#define NSPIPE2
@@ -290,11 +293,20 @@ main(int argc, char* argv[])
#else
#ifdef XP_MAC
/* Mac stuff is missing here! */
#else
#ifdef XP_OS2
QMSG qmsg;
if (WinGetMsg(0, &qmsg, 0, 0, 0))
WinDispatchMsg(0, &qmsg);
else
gKeepRunning = FALSE;
#else
PLEvent *gEvent;
rv = gEventQ->GetEvent(&gEvent);
rv = gEventQ->HandleEvent(gEvent);
#endif
#endif
#endif
}

View File

@@ -24,6 +24,9 @@
#ifdef WIN32
#include <windows.h>
#endif
#ifdef XP_OS2
#include <os2.h>
#endif
#include "nscore.h"
#include "nsCOMPtr.h"
@@ -181,11 +184,21 @@ main(int argc, char* argv[])
#else
#ifdef XP_MAC
/* Mac stuff is missing here! */
#else
#ifdef XP_OS2
QMSG qmsg;
if (WinGetMsg(0, &qmsg, 0, 0, 0))
WinDispatchMsg(0, &qmsg);
else
gKeepRunning = FALSE;
#else
PLEvent *gEvent;
rv = eventQ->GetEvent(&gEvent);
rv = eventQ->HandleEvent(gEvent);
#endif
#endif
#endif
}

View File

@@ -25,6 +25,9 @@
//#define USE_TIMERS // Only use nsITimer on Windows (for now...)
#include <windows.h>
#endif
#ifdef XP_OS2
#include <os2.h>
#endif
#include "nspr.h"
#ifdef XP_MAC
@@ -91,6 +94,13 @@ void Pump_PLEvents(nsIEventQueueService * eventQService)
} else {
gKeepRunning = FALSE;
}
#elif defined(XP_OS2)
QMSG qmsg;
if (WinGetMsg(0, &qmsg, 0, 0, 0))
WinDispatchMsg(0, &qmsg);
else
gKeepRunning = FALSE;
#else
nsresult rv;
PLEvent *gEvent;