removing old NSPR20 #ifdefs

This commit is contained in:
cyeh%netscape.com 1998-09-24 20:47:57 +00:00
parent bdcaa90d13
commit b1100a8e31
9 changed files with 5 additions and 139 deletions

View File

@ -988,11 +988,7 @@ void do_spellcheck( MWContext *mwcontext, CEditView *editView, CSimpleTextView *
try {
#ifdef USE_DYNAMIC_SC_LIB
sc_create_func sc_createProc;
#ifndef NSPR20
sc_createProc = (sc_create_func)PR_FindSymbol( "SC_Create", spellCheckerLib );
#else
sc_createProc = (sc_create_func)PR_FindSymbol( spellCheckerLib, "SC_Create" );
#endif
if ( sc_createProc == NULL )
{
ErrorManager::PlainAlert( NO_SPELL_SHLB_FOUND );

View File

@ -440,11 +440,7 @@ OSErr CPluginHandler::InitCodeResource(NPNetscapeFuncs* funcs, _np_handle* handl
ThrowIf_(res != NS_OK);
handle->userPlugin = plugin;
} else {
#ifndef NSPR20
fMainEntryFunc = (NPP_MainEntryUPP) PR_FindSymbol("mainRD", fLibrary);
#else
fMainEntryFunc = (NPP_MainEntryUPP) PR_FindSymbol(fLibrary, "mainRD");
#endif
ThrowIfNil_(fMainEntryFunc);
}
}

View File

@ -21,9 +21,6 @@
#include "CBrowserContext.h"
#include "CNSContextCallbacks.h"
#include "CHTMLView.h"
#ifndef NSPR20
#include "CNetwork.h"
#endif
#include "UStdDialogs.h"
#include "UFormElementFactory.h"
#include "CAutoPtrXP.h"

View File

@ -22,9 +22,6 @@
#include "CNSContext.h"
#include "CNSContextCallbacks.h"
#include "CHTMLView.h"
#ifndef NSPR20
#include "CNetwork.h"
#endif
#include "UStdDialogs.h"
#include "CURLEditField.h"
#include "CMochaHacks.h"
@ -788,11 +785,6 @@ void CNSContext::Alert(
void CNSContext::SetCallNetlibAllTheTime(void)
{
#ifndef NSPR20
extern CNetworkDriver* gNetDriver;
Assert_(gNetDriver != NULL);
gNetDriver->SetCallAllTheTime();
#endif
}
@ -802,21 +794,11 @@ void CNSContext::SetCallNetlibAllTheTime(void)
void CNSContext::ClearCallNetlibAllTheTime(void)
{
#ifndef NSPR20
extern CNetworkDriver* gNetDriver;
Assert_(gNetDriver != NULL);
gNetDriver->ClearCallAllTheTime();
#endif
}
// A temporary abortion, we need this routine outside of MWContext function table
void XP_ClearCallNetlibAllTheTime(MWContext *)
{
#ifndef NSPR20
extern CNetworkDriver* gNetDriver;
Assert_(gNetDriver != NULL);
gNetDriver->SetCallAllTheTime();
#endif
}
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ

View File

@ -28,9 +28,6 @@
#include "uapp.h"
#include "CNSContext.h"
// Network
#ifndef NSPR20
#include "CNetwork.h"
#endif
// Netscape
#include "secrng.h"
// utilities
@ -44,12 +41,10 @@ extern "C" {
#include "resgui.h"
#ifdef NSPR20
#include "prthread.h"
PR_BEGIN_EXTERN_C
PR_EXTERN(PRThread*) PR_GetPrimaryThread(void);
PR_END_EXTERN_C
#endif
/*-----------------------------------------------------------------------------
Earl Manager
@ -99,26 +94,11 @@ void EarlManager::SpendTime( const EventRecord& /*inMacEvent*/)
// appropriate time, and make sure that our priority is
// low so that other java threads an run.
#ifndef NSPR20
// If we don't have a gNetDriver then we better not call it
if (!gNetDriver)
return;
PR_SetThreadPriority(PR_CurrentThread(), 0);
gNetDriver->SpendTime();
#else
PR_SetThreadPriority(PR_CurrentThread(), PR_PRIORITY_LOW);
#endif
unsigned char dst;
RNG_GenerateGlobalRandomBytes(&dst, 1);
#ifdef NSPR20_DISABLED
CSelectObject socketToCallWith;
if (gNetDriver->CanCallNetlib(socketToCallWith))
NET_ProcessNet(MacToStdSocketID(socketToCallWith.fID), SocketSelectToFD_Type(socketToCallWith.fType));
#else
NET_PollSockets();
#endif
if ( fInterruptContext )
{
NET_InterruptWindow( fInterruptContext );
@ -303,78 +283,35 @@ int EarlManagerNetTicklerCallback(void)
}
}
#ifdef NSPR20_DISABLED
int SocketSelectToFD_Type(SocketSelect s)
{
switch (s) {
case eReadSocket:
case eExceptionSocket:
return NET_SOCKET_FD;
case eLocalFileSocket:
return NET_LOCAL_FILE_FD;
case eEverytimeSocket:
return NET_EVERYTIME_TYPE;
}
return 0; // Never reached
}
#endif
// FE Select routines
void FE_SetReadSelect (MWContext * /* context */, int sd)
{
#ifndef NSPR20
gNetDriver->SetReadSelect(sd);
#endif
}
void FE_ClearReadSelect (MWContext */* context */, int sd)
{
#ifndef NSPR20
gNetDriver->ClearReadSelect(sd);
#endif
}
void FE_SetConnectSelect (MWContext */* context */, int sd)
{
#ifndef NSPR20
gNetDriver->SetConnectSelect(sd);
#endif
}
void FE_ClearConnectSelect(MWContext */* context */, int sd)
{
#ifndef NSPR20
gNetDriver->ClearConnectSelect(sd);
#endif
}
void FE_SetFileReadSelect (MWContext */* context */, int fd)
{
#ifndef NSPR20
gNetDriver->SetFileReadSelect(fd);
#endif
}
void FE_ClearFileReadSelect (MWContext */* context */, int fd)
{
#ifndef NSPR20
gNetDriver->ClearFileReadSelect(fd);
#endif
}
int FE_StartAsyncDNSLookup (MWContext */* context */, char * host_port, void ** hoststruct_ptr_ptr, int sock)
{
#ifndef NSPR20
*hoststruct_ptr_ptr = NULL;
int err = gNetDriver->StartAsyncDNSLookup(host_port, (struct hostent **)hoststruct_ptr_ptr, sock);
if (err == EAGAIN) // Because macsock knows nothing of netlib defines
return MK_WAITING_FOR_LOOKUP;
else
return err;
#endif
return MK_WAITING_FOR_LOOKUP;
}

View File

@ -17,11 +17,7 @@
*/
#include <Types.h>
#ifndef NSPR20
#include "prmacros.h"
#else
#include "prtypes.h"
#endif
NSPR_BEGIN_EXTERN_C

View File

@ -38,9 +38,6 @@
#include "uerrmgr.h"
#include "resgui.h"
#include "CIconCache.h"
#ifndef NSPR20
#include "prglobal.h"
#endif
#include "MacMemAllocator.h"
#include "xlate.h"

View File

@ -91,9 +91,6 @@
#include "LMenuSharing.h"
#define MENU_SHARING_FIRST 40
#ifndef NSPR20
#include "CNetwork.h"
#endif
#include "CEnvironment.h"
#include "CWindowMenu.h"
@ -158,10 +155,7 @@
#include "InternetConfig.h"
#include "il_strm.h" /* Image Library stream converters. */
#ifdef MOCHA
//#include "libmocha.h"
#include "CMochaHacks.h"
#endif
PRThread* mozilla_thread;
@ -908,11 +902,6 @@ CFrontApp::CFrontApp()
InitUTearOffPalette(this);
CTearOffManager::GetDefaultManager()->AddListener(this);
// ¥Ênetwork
#ifndef NSPR20
CNetworkDriver::CreateNetworkDriver();
#endif
TheEarlManager.StartRepeating();
// WTSMManager::Initialize();
@ -1060,23 +1049,12 @@ CFrontApp::~CFrontApp()
PR_ProcessPendingEvents(mozilla_event_queue);
//-----
#ifndef NSPR20
if (gNetDriver && !fStartupAborted)
{
extern const char* CacheFilePrefix;
NET_CleanupCacheDirectory( "", CacheFilePrefix );
NET_ShutdownNetLib();
delete gNetDriver;
gNetDriver = NULL;
}
#else
if (!fStartupAborted)
{
extern const char* CacheFilePrefix;
NET_CleanupCacheDirectory( "", CacheFilePrefix );
NET_ShutdownNetLib();
}
#endif
if (!fStartupAborted)
CPrefs::DoWrite();
@ -1663,11 +1641,8 @@ void CFrontApp::ProperStartup( FSSpec* file, short fileType )
possible. */
if ((PR_GetGCInfo() != NULL) && (PR_GetGCInfo()->finalizer != NULL))
#ifndef NSPR20
PR_SetThreadPriority(PR_GetGCInfo()->finalizer, 31);
#else
PR_SetThreadPriority(PR_GetGCInfo()->finalizer, PR_PRIORITY_URGENT);
#endif
PR_SetThreadPriority(PR_GetGCInfo()->finalizer, PR_PRIORITY_URGENT);
DestroySplashScreen();
if ( abortStartup == CPrefs::eRunAccountSetup )
@ -3710,13 +3685,9 @@ void main( void )
#endif
// NSPR/MOCHA Initialization
#ifndef NSPR20
PR_Init("Navigator", 0,0,0);
#endif
mozilla_thread = PR_CurrentThread();
#ifdef NSPR20
PR_SetThreadGCAble();
#endif
// ¥ initialize the memory manager
// it's important that this is done VERY early
@ -4107,12 +4078,9 @@ CFrontApp::ProcessNextEvent()
}
#ifdef DAVIDM_SPEED2
#ifndef NSPR20
CSelectObject socketToCallWith;
Boolean doWNE = haveUserEvent || ::LMGetTicks() > sNextWNETicks || ( gNetDriver && !gNetDriver->CanCallNetlib(socketToCallWith) );
#else
Boolean doWNE = haveUserEvent || ::LMGetTicks() > sNextWNETicks || NET_PollSockets();
#endif // NSPR_20
SetUpdateCommandStatus(false);
if ( doWNE )

View File

@ -16,9 +16,6 @@
* Reserved.
*/
#ifndef NSPR20
#include "prmacos.h"
#endif
#include "fredmem.h"
#include "shist.h"