mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
remove #ifdef NSPR in preparation for turning off NSPR and NSPR20 compile defines
This commit is contained in:
parent
5768dcef3d
commit
738e0dcfa0
@ -1,4 +1,4 @@
|
||||
/* $Id: qtmoz.cpp,v 1.4 1998/10/03 20:13:57 cls%seawood.org Exp $
|
||||
/* $Id: qtmoz.cpp,v 1.5 1998/10/08 21:24:44 cyeh%netscape.com Exp $
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
@ -55,9 +55,7 @@
|
||||
#include "np.h"
|
||||
#include "secnav.h"
|
||||
#include "secrng.h"
|
||||
#ifdef NSPR20
|
||||
#include "private/prpriv.h" /* for PR_NewNamedMonitor */
|
||||
#endif /* NSPR20 */
|
||||
|
||||
#include "libimg.h" /* Image Library public API. */
|
||||
|
||||
@ -67,11 +65,7 @@
|
||||
#include "libmocha.h"
|
||||
|
||||
#include "prnetdb.h"
|
||||
#ifndef NSPR20
|
||||
#include "prevent.h"
|
||||
#else
|
||||
#include "plevent.h"
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#include "bkmks.h" /* for drag and drop in mail compose */
|
||||
@ -1079,12 +1073,7 @@ mozilla_main(int argc, char** argv)
|
||||
fe_progname_long = fe_locate_program_path (argv [0]);
|
||||
#endif
|
||||
|
||||
#if defined(NSPR20)
|
||||
PR_UnblockClockInterrupts();
|
||||
#else
|
||||
/* Now we can turn the nspr clock on */
|
||||
PR_StartEvents(0);
|
||||
#endif /* NSPR20 */
|
||||
|
||||
int fd;
|
||||
|
||||
@ -1156,10 +1145,7 @@ mozilla_main(int argc, char** argv)
|
||||
const char *host;
|
||||
|
||||
inaddr.s_addr = addr;
|
||||
#ifndef NSPR20
|
||||
hp = PR_gethostbyaddr((char *)&inaddr, sizeof inaddr, AF_INET,
|
||||
&hpbuf, dbbuf, sizeof(dbbuf), 0);
|
||||
#else
|
||||
|
||||
PRStatus sts;
|
||||
PRNetAddr pr_addr;
|
||||
|
||||
@ -1170,7 +1156,6 @@ mozilla_main(int argc, char** argv)
|
||||
hp = NULL;
|
||||
else
|
||||
hp = &hpbuf;
|
||||
#endif
|
||||
host = (hp == NULL) ? inet_ntoa(inaddr) : hp->h_name;
|
||||
fmt = PR_sprintf_append(fmt,
|
||||
XP_GetString(QTFE_APPEARS_TO_BE_RUNNING_ON_HOST_UNDER_PID),
|
||||
@ -1511,13 +1496,6 @@ fe_create_pidlock (const char *name, unsigned long *paddr, pid_t *ppid)
|
||||
char *colon, *after;
|
||||
pid_t pid;
|
||||
|
||||
#ifndef NSPR20
|
||||
if (gethostname (hostname, sizeof hostname) < 0 ||
|
||||
(hp = PR_gethostbyname (hostname, &hpbuf, dbbuf, sizeof(dbbuf), 0)) == NULL)
|
||||
inaddr.s_addr = INADDR_LOOPBACK;
|
||||
else
|
||||
memcpy (&inaddr, hp->h_addr, sizeof inaddr);
|
||||
#else
|
||||
{
|
||||
PRStatus sts;
|
||||
|
||||
@ -1534,7 +1512,6 @@ fe_create_pidlock (const char *name, unsigned long *paddr, pid_t *ppid)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
myaddr = inaddr.s_addr;
|
||||
signature = PR_smprintf ("%s:%u", inet_ntoa (inaddr), (unsigned)getpid ());
|
||||
|
@ -775,14 +775,10 @@ WH_TempFileName(int type, const char * request_prefix, const char * extension)
|
||||
{
|
||||
static char file_buf[_MAX_PATH]; /* protected by _pr_TempName_lock */
|
||||
char* result;
|
||||
#ifdef NSPR
|
||||
XP_ASSERT(_pr_TempName_lock);
|
||||
PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
result = XP_STRDUP(xp_TempFileName(type, request_prefix, extension, file_buf));
|
||||
#ifdef NSPR
|
||||
PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -3744,14 +3740,10 @@ WH_TempName(XP_FileType type, const char * prefix)
|
||||
{
|
||||
static char buf[_MAX_PATH]; /* protected by _pr_TempName_lock */
|
||||
char* result;
|
||||
#ifdef NSPR
|
||||
XP_ASSERT(_pr_TempName_lock);
|
||||
PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
result = XP_STRDUP(xp_TempFileName(type, prefix, NULL, buf));
|
||||
#ifdef NSPR
|
||||
PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -3765,14 +3757,10 @@ WH_FileName (const char *name, XP_FileType type)
|
||||
** I'm not sure this lock is really needed by windows, but just
|
||||
** to be safe:
|
||||
*/
|
||||
#ifdef NSPR
|
||||
// XP_ASSERT(_pr_TempName_lock);
|
||||
// PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
result = xp_FileName(name, type, &myName);
|
||||
#ifdef NSPR
|
||||
// PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
return myName;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#ifndef mozjava_h___
|
||||
#define mozjava_h___
|
||||
|
||||
#if defined(NSPR) || defined(JAVA)
|
||||
#include "prthread.h"
|
||||
#include "prmon.h"
|
||||
#include "prio.h"
|
||||
@ -29,7 +28,6 @@
|
||||
#ifdef JAVA
|
||||
#include "java.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef JAVA
|
||||
extern PRMonitor *fdset_lock;
|
||||
|
@ -1623,9 +1623,7 @@ XP_Bool XP_FileIsFullPath(const char * name)
|
||||
|
||||
#if !defined(XP_WIN) && !defined(XP_OS2)
|
||||
|
||||
#ifdef NSPR
|
||||
PRMonitor* _pr_TempName_lock = NULL;
|
||||
#endif
|
||||
|
||||
PUBLIC char *
|
||||
WH_FileName (const char *name, XP_FileType type)
|
||||
@ -1633,21 +1631,17 @@ WH_FileName (const char *name, XP_FileType type)
|
||||
static char buf [1024]; /* protected by _pr_TempName_lock */
|
||||
static char configBuf [1024]; /* protected by _pr_TempName_lock */
|
||||
char* result;
|
||||
#ifdef NSPR
|
||||
if (_pr_TempName_lock == NULL) {
|
||||
_pr_TempName_lock = PR_NewNamedMonitor("TempName-lock");
|
||||
}
|
||||
PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
/* reset
|
||||
*/
|
||||
buf[0] = '\0';
|
||||
result = xp_FileName(name, type, buf, configBuf);
|
||||
if (result)
|
||||
result = XP_STRDUP(result);
|
||||
#ifdef NSPR
|
||||
PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1656,16 +1650,12 @@ WH_FilePlatformName(const char * name)
|
||||
{
|
||||
char* result;
|
||||
static char path[300]; /* Names longer than 300 are not dealt with in our stdio */
|
||||
#ifdef NSPR
|
||||
if (_pr_TempName_lock == NULL) {
|
||||
_pr_TempName_lock = PR_NewNamedMonitor("TempName-lock");
|
||||
}
|
||||
PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
result = xp_FilePlatformName(name, path);
|
||||
#ifdef NSPR
|
||||
PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
if (result)
|
||||
result = XP_STRDUP(result);
|
||||
|
||||
@ -1680,18 +1670,14 @@ WH_TempName(XP_FileType type, const char * prefix)
|
||||
static char buf2 [100];
|
||||
static unsigned int count = 0;
|
||||
char* result;
|
||||
#ifdef NSPR
|
||||
if (_pr_TempName_lock == NULL) {
|
||||
_pr_TempName_lock = PR_NewNamedMonitor("TempName-lock");
|
||||
}
|
||||
PR_EnterMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
result = xp_TempName(type, prefix, buf, buf2, &count);
|
||||
if (result)
|
||||
result = XP_STRDUP(result);
|
||||
#ifdef NSPR
|
||||
PR_ExitMonitor(_pr_TempName_lock);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user