Bug 1119469: update NSPR to NSPR_4_10_8_BETA2 r=ted
authorLandry Breuil <landry@openbsd.org>
Fri, 09 Jan 2015 09:58:22 +0100
changeset 248799 f4b590e58d863eb6f714556efab7872b4a95ee65
parent 248798 1f43f1fcfd047777d24463847924c36eb4259491
child 248800 d4a53398ac445e0b02423495291ec88c04f7d64b
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1119469, 1106600, 1105144, 1072454, 1107063, 756047, 782113, 1060292, 573192, 1060401
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1119469: update NSPR to NSPR_4_10_8_BETA2 r=ted Uplifts bugs 1106600, 1105144, 1072454, 1107063, 756047, 782113, 1060292, 573192 and 1060401
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/config/rules.mk
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/md/_freebsd.cfg
nsprpub/pr/include/md/_freebsd.h
nsprpub/pr/include/prinit.h
nsprpub/pr/src/cplus/rcnetdb.cpp
nsprpub/pr/src/io/prfdcach.c
nsprpub/pr/src/io/priometh.c
nsprpub/pr/src/io/prlog.c
nsprpub/pr/src/io/prmwait.c
nsprpub/pr/src/linking/prlink.c
nsprpub/pr/src/md/os2/os2thred.c
nsprpub/pr/src/misc/prolock.c
nsprpub/pr/src/pthreads/ptthread.c
nsprpub/pr/src/threads/combined/pruthr.c
nsprpub/pr/tests/io_timeout.c
nsprpub/pr/tests/multiwait.c
nsprpub/pr/tests/nblayer.c
nsprpub/pr/tests/priotest.c
nsprpub/pr/tests/rwlockrank.c
nsprpub/pr/tests/socket.c
nsprpub/pr/tests/testfile.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_10_7_RTM
+NSPR_4_10_8_BETA2
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/config/rules.mk
+++ b/nsprpub/config/rules.mk
@@ -78,25 +78,29 @@ ifeq (,$(filter-out WINNT WINCE OS2,$(OS
 
 #
 # Win95 and OS/2 require library names conforming to the 8.3 rule.
 # other platforms do not.
 #
 ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET)))
 LIBRARY		= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
 SHARED_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
-IMPORT_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
 SHARED_LIB_PDB	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
 else
 LIBRARY		= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
 SHARED_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
-IMPORT_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
 SHARED_LIB_PDB	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
 endif
 
+ifdef MSC_VER
+IMPORT_LIBRARY  = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
+else
+IMPORT_LIBRARY  = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
+endif
+
 else
 
 LIBRARY		= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
 ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 SHARED_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
 else
 ifdef MKSHLIB
 SHARED_LIBRARY	= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -2484,17 +2484,17 @@ case $target_os in *\ *) target_os=`echo
 # will get canonicalized.
 test -n "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=7
+MOD_PATCH_VERSION=8
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
 USE_64=
@@ -7377,17 +7377,17 @@ tools are selected during the Xcode/Deve
     DLL_SUFFIX=so.1.0
     DSO_CFLAGS=-fPIC
     MDCPUCFG_H=_openbsd.cfg
     PR_MD_CSRCS=openbsd.c
     OS_LIBS="-lc"
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
-    DSO_LDOPTS='-shared -fPIC'
+    DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     ;;
 
 *-osf*)
     SHELL_OVERRIDE="SHELL		= /usr/bin/ksh"
     $as_echo "#define XP_UNIX 1" >>confdefs.h
 
     $as_echo "#define OSF1 1" >>confdefs.h
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -11,17 +11,17 @@ AC_CONFIG_SRCDIR([pr/include/nspr.h])
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_TARGET
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=7
+MOD_PATCH_VERSION=8
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
 USE_64=
@@ -2173,17 +2173,17 @@ tools are selected during the Xcode/Deve
     DLL_SUFFIX=so.1.0
     DSO_CFLAGS=-fPIC
     MDCPUCFG_H=_openbsd.cfg
     PR_MD_CSRCS=openbsd.c
     OS_LIBS="-lc"
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
-    DSO_LDOPTS='-shared -fPIC'
+    DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     ;;
 
 *-osf*)
     SHELL_OVERRIDE="SHELL		= /usr/bin/ksh"
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(OSF1)
     AC_DEFINE(_REENTRANT)
--- a/nsprpub/pr/include/md/_freebsd.cfg
+++ b/nsprpub/pr/include/md/_freebsd.cfg
@@ -246,16 +246,157 @@
 #define PR_ALIGN_OF_INT     4
 #define PR_ALIGN_OF_LONG    8
 #define PR_ALIGN_OF_INT64   8
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 #define PR_ALIGN_OF_WORD    8
 
+#elif defined(__powerpc64__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN    1
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2   3
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#elif defined(__powerpc__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN    1
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD    4
+
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#elif defined(__arm__)
+
+#if defined(__ARMEB__) || defined(__ARM_BIG_ENDIAN__)
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN    1
+#else
+#undef  IS_BIG_ENDIAN
+#define IS_LITTLE_ENDIAN 1
+#endif
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD    4
+
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
 #else
 
 #error "Unknown CPU architecture"
 
 #endif
 
 #ifndef NO_NSPR_10_SUPPORT
 
--- a/nsprpub/pr/include/md/_freebsd.h
+++ b/nsprpub/pr/include/md/_freebsd.h
@@ -20,16 +20,22 @@
 #elif defined(__alpha__)
 #define _PR_SI_ARCHITECTURE "alpha"
 #elif defined(__sparc__)
 #define _PR_SI_ARCHITECTURE "sparc"
 #elif defined(__ia64__)
 #define _PR_SI_ARCHITECTURE "ia64"
 #elif defined(__amd64__)
 #define _PR_SI_ARCHITECTURE "amd64"
+#elif defined(__powerpc64__)
+#define _PR_SI_ARCHITECTURE "powerpc64"
+#elif defined(__powerpc__)
+#define _PR_SI_ARCHITECTURE "powerpc"
+#elif defined(__arm__)
+#define _PR_SI_ARCHITECTURE "arm"
 #else
 #error "Unknown CPU architecture"
 #endif
 #if defined(__ELF__)
 #define PR_DLL_SUFFIX          ".so"
 #else
 #define PR_DLL_SUFFIX          ".so.1.0"
 #endif
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.10.7"
+#define PR_VERSION  "4.10.8 Beta"
 #define PR_VMAJOR   4
 #define PR_VMINOR   10
-#define PR_VPATCH   7
-#define PR_BETA     PR_FALSE
+#define PR_VPATCH   8
+#define PR_BETA     PR_TRUE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/src/cplus/rcnetdb.cpp
+++ b/nsprpub/pr/src/cplus/rcnetdb.cpp
@@ -30,17 +30,17 @@ RCNetAddr::RCNetAddr(const RCNetAddr& hi
 
 RCNetAddr::RCNetAddr(RCNetAddr::HostValue host, PRUint16 port): RCBase()
 {
     PRNetAddrValue how;
     switch (host)
     {
         case RCNetAddr::any: how = PR_IpAddrAny; break;
         case RCNetAddr::loopback: how = PR_IpAddrLoopback; break;
-        default: PR_ASSERT(!"This can't happen -- and did!");
+        default: PR_NOT_REACHED("This can't happen -- and did!");
     }
     (void)PR_InitializeNetAddr(how, port, &address);
 }  /* RCNetAddr::RCNetAddr */
 
 RCNetAddr::~RCNetAddr() { }
 
 void RCNetAddr::operator=(const RCNetAddr& his) { address = his.address; }
 
--- a/nsprpub/pr/src/io/prfdcach.c
+++ b/nsprpub/pr/src/io/prfdcach.c
@@ -26,23 +26,21 @@
 ** the number of descriptors NSPR will allocate before beginning to
 ** recycle. The latter is the maximum number permitted in the cache
 ** (exclusive of those in use) at a time.
 */
 typedef struct _PR_Fd_Cache
 {
     PRLock *ml;
     PRIntn count;
-    PRStack *stack;
     PRFileDesc *head, *tail;
     PRIntn limit_low, limit_high;
 } _PR_Fd_Cache;
 
 static _PR_Fd_Cache _pr_fd_cache;
-static PRFileDesc **stack2fd = &(((PRFileDesc*)NULL)->higher);
 
 
 /*
 ** Get a FileDescriptor from the cache if one exists. If not allocate
 ** a new one from the heap.
 */
 PRFileDesc *_PR_Getfd(void)
 {
@@ -54,21 +52,17 @@ PRFileDesc *_PR_Getfd(void)
     ** the differences. If it isn't too annoying, I'll leave it in.
     ** $$$$
     **
     ** The test is against _pr_fd_cache.limit_high. If that's zero,
     ** we're not doing the extended cache but going for performance.
     */
     if (0 == _pr_fd_cache.limit_high)
     {
-        PRStackElem *pop;
-        PR_ASSERT(NULL != _pr_fd_cache.stack);
-        pop = PR_StackPop(_pr_fd_cache.stack);
-        if (NULL == pop) goto allocate;
-        fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
+        goto allocate;
     }
     else
     {
         do
         {
             if (NULL == _pr_fd_cache.head) goto allocate;  /* nothing there */
             if (_pr_fd_cache.count < _pr_fd_cache.limit_low) goto allocate;
 
@@ -123,28 +117,19 @@ allocate:
 */
 void _PR_Putfd(PRFileDesc *fd)
 {
     PR_ASSERT(PR_NSPR_IO_LAYER == fd->identity);
     fd->methods = &_pr_faulty_methods;
     fd->identity = PR_INVALID_IO_LAYER;
     fd->secret->state = _PR_FILEDESC_FREED;
 
-    if (0 == _pr_fd_cache.limit_high)
-    {
-        PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher));
-    }
-    else
+    if (0 != _pr_fd_cache.limit_high)
     {
-        if (_pr_fd_cache.count > _pr_fd_cache.limit_high)
-        {
-            PR_Free(fd->secret);
-            PR_Free(fd);
-        }
-        else
+        if (_pr_fd_cache.count < _pr_fd_cache.limit_high)
         {
             PR_Lock(_pr_fd_cache.ml);
             if (NULL == _pr_fd_cache.tail)
             {
                 PR_ASSERT(0 == _pr_fd_cache.count);
                 PR_ASSERT(NULL == _pr_fd_cache.head);
                 _pr_fd_cache.head = _pr_fd_cache.tail = fd;
             }
@@ -152,74 +137,38 @@ void _PR_Putfd(PRFileDesc *fd)
             {
                 PR_ASSERT(NULL == _pr_fd_cache.tail->higher);
                 _pr_fd_cache.tail->higher = fd;
                 _pr_fd_cache.tail = fd;  /* new value */
             }
             fd->higher = NULL;  /* always so */
             _pr_fd_cache.count += 1;  /* count the new entry */
             PR_Unlock(_pr_fd_cache.ml);
+            return;
         }
     }
+
+    PR_Free(fd->secret);
+    PR_Free(fd);
 }  /* _PR_Putfd */
 
 PR_IMPLEMENT(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high)
 {
     /*
     ** This can be called at any time, may adjust the cache sizes,
     ** turn the caches off, or turn them on. It is not dependent
     ** on the compilation setting of DEBUG.
     */
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
     if (low > high) low = high;  /* sanity check the params */
     
     PR_Lock(_pr_fd_cache.ml);
-    if (0 == high)  /* shutting down or staying down */
-    {
-        if (0 != _pr_fd_cache.limit_high)  /* shutting down */
-        {
-            _pr_fd_cache.limit_high = 0;  /* stop use */
-            /*
-            ** Hold the lock throughout - nobody's going to want it
-            ** other than another caller to this routine. Just don't
-            ** let that happen.
-            **
-            ** Put all the cached fds onto the new cache.
-            */
-            while (NULL != _pr_fd_cache.head)
-            {
-                PRFileDesc *fd = _pr_fd_cache.head;
-                _pr_fd_cache.head = fd->higher;
-                PR_StackPush(_pr_fd_cache.stack, (PRStackElem*)(&fd->higher));
-            }
-            _pr_fd_cache.limit_low = 0;
-            _pr_fd_cache.tail = NULL;
-            _pr_fd_cache.count = 0;
-        }
-    }
-    else  /* starting up or just adjusting parameters */
-    {
-        PRBool was_using_stack = (0 == _pr_fd_cache.limit_high);
-        _pr_fd_cache.limit_low = low;
-        _pr_fd_cache.limit_high = high;
-        if (was_using_stack)  /* was using stack - feed into cache */
-        {
-            PRStackElem *pop;
-            while (NULL != (pop = PR_StackPop(_pr_fd_cache.stack)))
-            {
-                PRFileDesc *fd = (PRFileDesc*)
-                    ((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
-                if (NULL == _pr_fd_cache.tail) _pr_fd_cache.tail = fd;
-                fd->higher = _pr_fd_cache.head;
-                _pr_fd_cache.head = fd;
-                _pr_fd_cache.count += 1;
-            }
-        }
-    }
+    _pr_fd_cache.limit_high = high;
+    _pr_fd_cache.limit_low = low;
     PR_Unlock(_pr_fd_cache.ml);
     return PR_SUCCESS;
 }  /* PR_SetFDCacheSize */
 
 void _PR_InitFdCache(void)
 {
     /*
     ** The fd caching is enabled by default for DEBUG builds,
@@ -253,18 +202,16 @@ void _PR_InitFdCache(void)
     if (_pr_fd_cache.limit_high > FD_SETSIZE)
         _pr_fd_cache.limit_high = FD_SETSIZE;
 
     if (_pr_fd_cache.limit_high < _pr_fd_cache.limit_low)
         _pr_fd_cache.limit_high = _pr_fd_cache.limit_low;
 
     _pr_fd_cache.ml = PR_NewLock();
     PR_ASSERT(NULL != _pr_fd_cache.ml);
-    _pr_fd_cache.stack = PR_CreateStack("FD");
-    PR_ASSERT(NULL != _pr_fd_cache.stack);
 
 }  /* _PR_InitFdCache */
 
 void _PR_CleanupFdCache(void)
 {
     PRFileDesc *fd, *next;
     PRStackElem *pop;
 
@@ -274,19 +221,11 @@ void _PR_CleanupFdCache(void)
         PR_DELETE(fd->secret);
         PR_DELETE(fd);
     }
     _pr_fd_cache.head = NULL;
     _pr_fd_cache.tail = NULL;
     _pr_fd_cache.count = 0;
     PR_DestroyLock(_pr_fd_cache.ml);
     _pr_fd_cache.ml = NULL;
-    while ((pop = PR_StackPop(_pr_fd_cache.stack)) != NULL)
-    {
-        fd = (PRFileDesc*)((PRPtrdiff)pop - (PRPtrdiff)stack2fd);
-        PR_DELETE(fd->secret);
-        PR_DELETE(fd);
-    }
-    PR_DestroyStack(_pr_fd_cache.stack);
-    _pr_fd_cache.stack = NULL;
 }  /* _PR_CleanupFdCache */
 
 /* prfdcach.c */
--- a/nsprpub/pr/src/io/priometh.c
+++ b/nsprpub/pr/src/io/priometh.c
@@ -46,55 +46,55 @@ PRIOMethods _pr_faulty_methods = {
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt,
     (PRReservedFN)_PR_InvalidInt
 };
 
 PRIntn _PR_InvalidInt(void)
 {
-    PR_ASSERT(!"I/O method is invalid");
+    PR_NOT_REACHED("I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return -1;
 }  /* _PR_InvalidInt */
 
 PRInt16 _PR_InvalidInt16(void)
 {
-    PR_ASSERT(!"I/O method is invalid");
+    PR_NOT_REACHED("I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return -1;
 }  /* _PR_InvalidInt */
 
 PRInt64 _PR_InvalidInt64(void)
 {
     PRInt64 rv;
     LL_I2L(rv, -1);
-    PR_ASSERT(!"I/O method is invalid");
+    PR_NOT_REACHED("I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return rv;
 }  /* _PR_InvalidInt */
 
 /*
  * An invalid method that returns PRStatus
  */
 
 PRStatus _PR_InvalidStatus(void)
 {
-    PR_ASSERT(!"I/O method is invalid");
+    PR_NOT_REACHED("I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return PR_FAILURE;
 }  /* _PR_InvalidDesc */
 
 /*
  * An invalid method that returns a pointer
  */
 
 PRFileDesc *_PR_InvalidDesc(void)
 {
-    PR_ASSERT(!"I/O method is invalid");
+    PR_NOT_REACHED("I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return NULL;
 }  /* _PR_InvalidDesc */
 
 PR_IMPLEMENT(PRDescType) PR_GetDescType(PRFileDesc *file)
 {
     return file->methods->file_type;
 }
--- a/nsprpub/pr/src/io/prlog.c
+++ b/nsprpub/pr/src/io/prlog.c
@@ -532,24 +532,29 @@ PR_IMPLEMENT(void) PR_LogFlush(void)
             }
         _PR_UNLOCK_LOG();
     }
 }
 
 PR_IMPLEMENT(void) PR_Abort(void)
 {
     PR_LogPrint("Aborting");
+#ifdef ANDROID
+    __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
+#endif
     abort();
 }
 
 PR_IMPLEMENT(void) PR_Assert(const char *s, const char *file, PRIntn ln)
 {
     PR_LogPrint("Assertion failure: %s, at %s:%d\n", s, file, ln);
     fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
     fflush(stderr);
 #ifdef WIN32
     DebugBreak();
-#endif
-#ifdef XP_OS2
+#elif defined(XP_OS2)
     asm("int $3");
+#elif defined(ANDROID)
+    __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
+                         s, file, ln);
 #endif
     abort();
 }
--- a/nsprpub/pr/src/io/prmwait.c
+++ b/nsprpub/pr/src/io/prmwait.c
@@ -653,17 +653,17 @@ static void NT_TimeProc(void *arg)
     bottom = PR_GetIdentitiesLayer(desc->fd, PR_NSPR_IO_LAYER);
     PR_ASSERT(NULL != bottom);
     if (NULL != bottom)  /* now what!?!?! */
     {
         bottom->secret->state = _PR_FILEDESC_CLOSED;
         if (closesocket(bottom->secret->md.osfd) == SOCKET_ERROR)
         {
             fprintf(stderr, "closesocket failed: %d\n", WSAGetLastError());
-            PR_ASSERT(!"What shall I do?");
+            PR_NOT_REACHED("What shall I do?");
         }
     }
     return;
 }  /* NT_TimeProc */
 
 static PRStatus NT_HashRemove(PRWaitGroup *group, PRFileDesc *fd)
 {
     PRRecvWait **waiter;
--- a/nsprpub/pr/src/linking/prlink.c
+++ b/nsprpub/pr/src/linking/prlink.c
@@ -1031,17 +1031,17 @@ PR_UnloadLibrary(PRLibrary *lib)
             }
             prev = next;
             next = next->next;
         }
         /*
          * fail (the library is not on the _pr_loadmap list),
          * but don't wipe out an error from dlclose/shl_unload.
          */
-        PR_ASSERT(!"_pr_loadmap and lib->refCount inconsistent");
+        PR_NOT_REACHED("_pr_loadmap and lib->refCount inconsistent");
         if (result == 0) {
             PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
             status = PR_FAILURE;
         }
     }
     /*
      * We free the PRLibrary structure whether dlclose/shl_unload
      * succeeds or not.
--- a/nsprpub/pr/src/md/os2/os2thred.c
+++ b/nsprpub/pr/src/md/os2/os2thred.c
@@ -267,33 +267,33 @@ void
     _exit(status);
 }
 
 #ifdef HAVE_THREAD_AFFINITY
 PR_EXTERN(PRInt32) 
 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask )
 {
    /* Can we do this on OS/2?  Only on SMP versions? */
-   PR_ASSERT(!"Not implemented");
+   PR_NOT_REACHED("Not implemented");
    return 0;
 
  /* This is what windows does:
     int rv;
 
     rv = SetThreadAffinityMask(thread->md.handle, mask);
 
     return rv?0:-1;
   */
 }
 
 PR_EXTERN(PRInt32)
 _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask)
 {
    /* Can we do this on OS/2?  Only on SMP versions? */
-   PR_ASSERT(!"Not implemented");
+   PR_NOT_REACHED("Not implemented");
    return 0;
 
  /* This is what windows does:
     PRInt32 rv, system_mask;
 
     rv = GetProcessAffinityMask(GetCurrentProcess(), mask, &system_mask);
     
     return rv?0:-1;
--- a/nsprpub/pr/src/misc/prolock.c
+++ b/nsprpub/pr/src/misc/prolock.c
@@ -14,43 +14,43 @@
 #include "prerror.h"
 
 PR_IMPLEMENT(PROrderedLock *) 
     PR_CreateOrderedLock( 
         PRInt32 order,
         const char *name
 )
 {
-    PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+    PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return NULL;
 } /*  end PR_CreateOrderedLock() */
 
 
 PR_IMPLEMENT(void) 
     PR_DestroyOrderedLock( 
         PROrderedLock *lock 
 )
 {
-    PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+    PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
 } /*  end PR_DestroyOrderedLock() */
 
 
 PR_IMPLEMENT(void) 
     PR_LockOrderedLock( 
         PROrderedLock *lock 
 )
 {
-    PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+    PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
 } /*  end PR_LockOrderedLock() */
 
 
 PR_IMPLEMENT(PRStatus) 
     PR_UnlockOrderedLock( 
         PROrderedLock *lock 
 )
 {
-    PR_ASSERT(!"Not implemented"); /* Not implemented yet */
+    PR_NOT_REACHED("Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return PR_FAILURE;
 } /*  end PR_UnlockOrderedLock() */
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -49,26 +49,26 @@ static struct _PT_Bookeeping
 {
     PRLock *ml;                 /* a lock to protect ourselves */
     PRCondVar *cv;              /* used to signal global things */
     PRInt32 system, user;       /* a count of the two different types */
     PRUintn this_many;          /* number of threads allowed for exit */
     pthread_key_t key;          /* thread private data key */
     PRBool keyCreated;          /* whether 'key' should be deleted */
     PRThread *first, *last;     /* list of threads we know about */
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     PRInt32 minPrio, maxPrio;   /* range of scheduling priorities */
 #endif
 } pt_book = {0};
 
 static void _pt_thread_death(void *arg);
 static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
 static void init_pthread_gc_support(void);
 
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
 static PRIntn pt_PriorityMap(PRThreadPriority pri)
 {
 #ifdef NTO
     /* This priority algorithm causes lots of problems on Neutrino
      * for now I have just hard coded everything to run at priority 10
      * until I can come up with a new algorithm.
      *     Jerry.Kirk@Nexwarecorp.com
      */
@@ -320,31 +320,31 @@ static PRThread* _PR_CreateThread(
     else if ((PRIntn)PR_PRIORITY_LAST < (PRIntn)priority)
         priority = PR_PRIORITY_LAST;
 
     rv = _PT_PTHREAD_ATTR_INIT(&tattr);
     PR_ASSERT(0 == rv);
 
     if (EPERM != pt_schedpriv)
     {
-#if !defined(_PR_DCETHREADS) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if !defined(_PR_DCETHREADS) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         struct sched_param schedule;
 #endif
 
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         rv = pthread_attr_setinheritsched(&tattr, PTHREAD_EXPLICIT_SCHED);
         PR_ASSERT(0 == rv);
 #endif
 
         /* Use the default scheduling policy */
 
 #if defined(_PR_DCETHREADS)
         rv = pthread_attr_setprio(&tattr, pt_PriorityMap(priority));
         PR_ASSERT(0 == rv);
-#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
         rv = pthread_attr_getschedparam(&tattr, &schedule);
         PR_ASSERT(0 == rv);
         schedule.sched_priority = pt_PriorityMap(priority);
         rv = pthread_attr_setschedparam(&tattr, &schedule);
         PR_ASSERT(0 == rv);
 #ifdef NTO
         rv = pthread_attr_setschedpolicy(&tattr, SCHED_RR); /* Round Robin */
         PR_ASSERT(0 == rv);
@@ -391,17 +391,17 @@ static PRThread* _PR_CreateThread(
         thred->priority = priority;
         if (PR_UNJOINABLE_THREAD == state)
             thred->state |= PT_THREAD_DETACHED;
 
         if (PR_LOCAL_THREAD == scope)
         	scope = PR_GLOBAL_THREAD;
 			
         if (PR_GLOBAL_BOUND_THREAD == scope) {
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     		rv = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
 			if (rv) {
 				/*
 				 * system scope not supported
 				 */
         		scope = PR_GLOBAL_THREAD;
 				/*
 				 * reset scope
@@ -466,17 +466,17 @@ static PRThread* _PR_CreateThread(
             	thred->state &= ~PT_THREAD_BOUND;
 			}
 #else
             /* Remember that we don't have thread scheduling privilege. */
             pt_schedpriv = EPERM;
             PR_LOG(_pr_thread_lm, PR_LOG_MIN,
                 ("_PR_CreateThread: no thread scheduling privilege"));
             /* Try creating the thread again without setting priority. */
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
             rv = pthread_attr_setinheritsched(&tattr, PTHREAD_INHERIT_SCHED);
             PR_ASSERT(0 == rv);
 #endif
 #endif	/* IRIX */
             rv = _PT_PTHREAD_CREATE(&id, tattr, _pt_root, thred);
         }
 #endif
 
@@ -687,17 +687,17 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(
     if ((PRIntn)PR_PRIORITY_FIRST > (PRIntn)newPri)
         newPri = PR_PRIORITY_FIRST;
     else if ((PRIntn)PR_PRIORITY_LAST < (PRIntn)newPri)
         newPri = PR_PRIORITY_LAST;
 
 #if defined(_PR_DCETHREADS)
     rv = pthread_setprio(thred->id, pt_PriorityMap(newPri));
     /* pthread_setprio returns the old priority */
-#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#elif _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     if (EPERM != pt_schedpriv)
     {
         int policy;
         struct sched_param schedule;
 
         rv = pthread_getschedparam(thred->id, &policy, &schedule);
         if(0 == rv) {
 			schedule.sched_priority = pt_PriorityMap(newPri);
@@ -916,17 +916,17 @@ void _PR_InitThreads(
      * initialized, but pthread_self() fails to initialize
      * pthreads and hence returns a null thread ID if invoked
      * by the primordial thread before any other pthread call.
      * So we explicitly initialize pthreads here.
      */
     pthread_init();
 #endif
 
-#if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
+#if defined(_PR_DCETHREADS) || _POSIX_THREAD_PRIORITY_SCHEDULING > 0
 #if defined(FREEBSD)
     {
     pthread_attr_t attr;
     int policy;
     /* get the min and max priorities of the default policy */
     pthread_attr_init(&attr);
     pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
     pthread_attr_getschedpolicy(&attr, &policy);
--- a/nsprpub/pr/src/threads/combined/pruthr.c
+++ b/nsprpub/pr/src/threads/combined/pruthr.c
@@ -68,23 +68,23 @@ void _PR_InitThreads(PRThreadType type, 
     PR_ASSERT(priority == PR_PRIORITY_NORMAL);
 
     _pr_terminationCVLock = PR_NewLock();
     _pr_activeLock = PR_NewLock();
 
 #ifndef HAVE_CUSTOM_USER_THREADS
     stack = PR_NEWZAP(PRThreadStack);
 #ifdef HAVE_STACK_GROWING_UP
-    stack->stackTop = (char*) ((((long)&type) >> _pr_pageShift)
+    stack->stackTop = (char*) ((((PRWord)&type) >> _pr_pageShift)
                   << _pr_pageShift);
 #else
 #if defined(SOLARIS) || defined (UNIXWARE) && defined (USR_SVR4_THREADS)
     stack->stackTop = (char*) &thread;
 #else
-    stack->stackTop = (char*) ((((long)&type + _pr_pageSize - 1)
+    stack->stackTop = (char*) ((((PRWord)&type + _pr_pageSize - 1)
                 >> _pr_pageShift) << _pr_pageShift);
 #endif
 #endif
 #else
     /* If stack is NULL, we're using custom user threads like NT fibers. */
     stack = PR_NEWZAP(PRThreadStack);
     if (stack) {
         stack->stackSize = 0;
@@ -169,22 +169,22 @@ static void _PR_InitializeNativeStack(PR
 {
     if( ts && (ts->stackTop == 0) ) {
         ts->allocSize = ts->stackSize;
 
         /*
         ** Setup stackTop and stackBottom values.
         */
 #ifdef HAVE_STACK_GROWING_UP
-    ts->allocBase = (char*) ((((long)&ts) >> _pr_pageShift)
+    ts->allocBase = (char*) ((((PRWord)&ts) >> _pr_pageShift)
                   << _pr_pageShift);
         ts->stackBottom = ts->allocBase + ts->stackSize;
         ts->stackTop = ts->allocBase;
 #else
-        ts->allocBase = (char*) ((((long)&ts + _pr_pageSize - 1)
+        ts->allocBase = (char*) ((((PRWord)&ts + _pr_pageSize - 1)
                 >> _pr_pageShift) << _pr_pageShift);
         ts->stackTop    = ts->allocBase;
         ts->stackBottom = ts->allocBase - ts->stackSize;
 #endif
     }
 }
 
 void _PR_NotifyJoinWaiters(PRThread *thread)
--- a/nsprpub/pr/tests/io_timeout.c
+++ b/nsprpub/pr/tests/io_timeout.c
@@ -67,17 +67,17 @@ thread_main(void *_info)
 			break;
 		case PR_GLOBAL_THREAD:
 			scope_str = GLOBAL_SCOPE_STRING;
 			break;
 		case PR_GLOBAL_BOUND_THREAD:
 			scope_str = GLOBAL_BOUND_SCOPE_STRING;
 			break;
 		default:
-			PR_ASSERT(!"Invalid thread scope");
+			PR_NOT_REACHED("Invalid thread scope");
 			break;
 	}
 	printf("thread id %d, scope %s\n", info->id, scope_str);
 
     listenSock = PR_NewTCPSocket();
     if (!listenSock) {
 		if (debug_mode)
         	printf("unable to create listen socket\n");
--- a/nsprpub/pr/tests/multiwait.c
+++ b/nsprpub/pr/tests/multiwait.c
@@ -501,17 +501,17 @@ static void PR_CALLBACK ServerThread(voi
     {
         if (verbosity > quiet)
             PR_fprintf(debug, "%s: Server accepting connection\n", shared->title);
         service = PR_Accept(listener, &client_address, PR_INTERVAL_NO_TIMEOUT);
         if (NULL == service)
         {
             if (PR_PENDING_INTERRUPT_ERROR == PR_GetError()) break;
             PL_PrintError("Accept failed");
-            MW_ASSERT(!"Accept failed");
+            MW_ASSERT(PR_FALSE && "Accept failed");
         }
         else
         {
             desc_in = CreateRecvWait(service, shared->timeout);
             desc_in->timeout = PR_INTERVAL_NO_TIMEOUT;
             if (verbosity > chatty)
                 PrintRecvDesc(desc_in, "Service adding");
             rv = PR_AddWaitFileDesc(shared->group, desc_in);
--- a/nsprpub/pr/tests/nblayer.c
+++ b/nsprpub/pr/tests/nblayer.c
@@ -99,17 +99,17 @@ static void PR_CALLBACK Client(void *arg
         do
         {
             polldesc.fd = stack;
             polldesc.out_flags = 0;
             polldesc.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
             ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
             if ((1 != ready)  /* if not 1, then we're dead */
             || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                { PR_ASSERT(!"Whoa!"); break; }
+                { PR_NOT_REACHED("Whoa!"); break; }
             if (verbosity > quiet)
                 PR_fprintf(
                     logFile, "Client connect 'in progress' [0x%x]\n",
                     polldesc.out_flags);
             rv = PR_GetConnectStatus(&polldesc);
             if ((PR_FAILURE == rv)
             && (PR_IN_PROGRESS_ERROR != PR_GetError())) break;
         } while (PR_FAILURE == rv);
@@ -138,17 +138,17 @@ static void PR_CALLBACK Client(void *arg
             else if ((-1 == ready) && (PR_WOULD_BLOCK_ERROR == PR_GetError()))
             {
                 polldesc.fd = stack;
                 polldesc.out_flags = 0;
                 polldesc.in_flags = PR_POLL_WRITE;
                 ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
                 if ((1 != ready)  /* if not 1, then we're dead */
                 || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                    { PR_ASSERT(!"Whoa!"); break; }
+                    { PR_NOT_REACHED("Whoa!"); break; }
             }
             else break;
         } while (bytes_sent < sizeof(buffer));
         PR_ASSERT(sizeof(buffer) == bytes_sent);
 
         bytes_read = 0;
         do
         {
@@ -166,17 +166,17 @@ static void PR_CALLBACK Client(void *arg
             else if ((-1 == ready) && (PR_WOULD_BLOCK_ERROR == PR_GetError()))
             {
                 polldesc.fd = stack;
                 polldesc.out_flags = 0;
                 polldesc.in_flags = PR_POLL_READ;
                 ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
                 if ((1 != ready)  /* if not 1, then we're dead */
                 || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                    { PR_ASSERT(!"Whoa!"); break; }
+                    { PR_NOT_REACHED("Whoa!"); break; }
             }
             else break;
         } while (bytes_read < bytes_sent);
         if (verbosity > chatty)
             PR_fprintf(logFile, "Client received %d bytes\n", bytes_read);
         PR_ASSERT(bytes_read == bytes_sent);
     }
 
@@ -208,17 +208,17 @@ static void PR_CALLBACK Server(void *arg
         if ((NULL == service) && (PR_WOULD_BLOCK_ERROR == PR_GetError()))
         {
             polldesc.fd = stack;
             polldesc.out_flags = 0;
             polldesc.in_flags = PR_POLL_READ | PR_POLL_EXCEPT;
             ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
             if ((1 != ready)  /* if not 1, then we're dead */
             || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                { PR_ASSERT(!"Whoa!"); break; }
+                { PR_NOT_REACHED("Whoa!"); break; }
         }
     } while (NULL == service);
     PR_ASSERT(NULL != service);
         
     if (verbosity > quiet)
         PR_fprintf(logFile, "Server accepting connection\n");
 
     do
@@ -239,17 +239,17 @@ static void PR_CALLBACK Server(void *arg
             else if ((-1 == ready) && (PR_WOULD_BLOCK_ERROR == PR_GetError()))
             {
                 polldesc.fd = service;
                 polldesc.out_flags = 0;
                 polldesc.in_flags = PR_POLL_READ;
                 ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
                 if ((1 != ready)  /* if not 1, then we're dead */
                 || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                    { PR_ASSERT(!"Whoa!"); break; }
+                    { PR_NOT_REACHED("Whoa!"); break; }
             }
             else break;
         } while (bytes_read < sizeof(buffer));
 
         if (0 != bytes_read)
         {
             if (verbosity > chatty)
                 PR_fprintf(logFile, "Server received %d bytes\n", bytes_read);
@@ -268,17 +268,17 @@ static void PR_CALLBACK Server(void *arg
                 else if ((-1 == ready) && (PR_WOULD_BLOCK_ERROR == PR_GetError()))
                 {
                     polldesc.fd = service;
                     polldesc.out_flags = 0;
                     polldesc.in_flags = PR_POLL_WRITE;
                     ready = PR_Poll(&polldesc, 1, PR_INTERVAL_NO_TIMEOUT);
                     if ((1 != ready)  /* if not 1, then we're dead */
                     || (0 == (polldesc.in_flags & polldesc.out_flags)))
-                        { PR_ASSERT(!"Whoa!"); break; }
+                        { PR_NOT_REACHED("Whoa!"); break; }
                 }
                 else break;
             } while (bytes_sent < bytes_read);
             PR_ASSERT(bytes_read == bytes_sent);
             if (verbosity > chatty)
                 PR_fprintf(logFile, "Server sent %d bytes\n", bytes_sent);
         }
     } while (0 != bytes_read);
@@ -324,17 +324,17 @@ static PRInt16 PR_CALLBACK MyPoll(
                 my_flags = (in_flags & ~PR_POLL_WRITE) | PR_POLL_READ;
                 break;
             case xmt_send_debit:
             case xmt_data:
                 my_flags = in_flags;
             default: break;
         }
     }
-    else PR_ASSERT(!"How'd I get here?");
+    else PR_NOT_REACHED("How'd I get here?");
     new_flags = (fd->lower->methods->poll)(fd->lower, my_flags, out_flags);
     if (verbosity > chatty)
         PR_fprintf(
             logFile, "Poll [i: 0x%x, m: 0x%x, o: 0x%x, n: 0x%x]\n",
             in_flags, my_flags, *out_flags, new_flags);
     return new_flags;
 }  /* MyPoll */
 
--- a/nsprpub/pr/tests/priotest.c
+++ b/nsprpub/pr/tests/priotest.c
@@ -181,14 +181,14 @@ int main(int argc, char **argv)
         while (loop--) PR_Sleep(oneSecond);
         if (debug_mode)
             PR_fprintf(debug_out, "high : low :: %d : %d\n", highCount, lowCount);
     }
 
 
     PR_ProcessExit((failed) ? 1 : 0);
 
-	PR_ASSERT(!"You can't get here -- but you did!");
+	PR_NOT_REACHED("You can't get here -- but you did!");
 	return 1;  /* or here */
 
 }  /* main */
 
 /* priotest.c */
--- a/nsprpub/pr/tests/rwlockrank.c
+++ b/nsprpub/pr/tests/rwlockrank.c
@@ -17,17 +17,17 @@ static PRRWLock *rwlock2;
 static void rwtest(void *args)
 {
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Unlock(rwlock1);
 
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Unlock(rwlock1);
 
-    // Test correct lock rank.
+    /* Test correct lock rank. */
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Rlock(rwlock2);
     PR_RWLock_Unlock(rwlock2);
     PR_RWLock_Unlock(rwlock1);
 
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Rlock(rwlock2);
     PR_RWLock_Unlock(rwlock1);
@@ -36,17 +36,17 @@ static void rwtest(void *args)
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Rlock(rwlock0);
     PR_RWLock_Rlock(rwlock2);
     PR_RWLock_Unlock(rwlock2);
     PR_RWLock_Unlock(rwlock0);
     PR_RWLock_Unlock(rwlock1);
 
 #if 0
-    // Test incorrect lock rank.
+    /* Test incorrect lock rank. */
     PR_RWLock_Rlock(rwlock2);
     PR_RWLock_Rlock(rwlock1);
     PR_RWLock_Unlock(rwlock1);
     PR_RWLock_Unlock(rwlock2);
 
     PR_RWLock_Rlock(rwlock2);
     PR_RWLock_Rlock(rwlock0);
     PR_RWLock_Rlock(rwlock1);
--- a/nsprpub/pr/tests/socket.c
+++ b/nsprpub/pr/tests/socket.c
@@ -323,17 +323,17 @@ PRInt32 native_thread = 0;
 			break;
 		case 2:
 			scope = (PR_GLOBAL_BOUND_THREAD);
 			break;
 		case 3:
 			native_thread = 1;
 			break;
 		default:
-			PR_ASSERT(!"Invalid scope");
+			PR_NOT_REACHED("Invalid scope");
 			break;
 	}
 	if (native_thread) {
 #if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
 		pthread_t tid;
 		if (!pthread_create(&tid, NULL, (void * (*)(void *)) start, arg))
 			return((PRThread *) tid);
 		else
--- a/nsprpub/pr/tests/testfile.c
+++ b/nsprpub/pr/tests/testfile.c
@@ -115,17 +115,17 @@ PRInt32 native_thread = 0;
 			break;
 		case 2:
 			scope = (PR_GLOBAL_BOUND_THREAD);
 			break;
 		case 3:
 			native_thread = 1;
 			break;
 		default:
-			PR_ASSERT(!"Invalid scope");
+			PR_NOT_REACHED("Invalid scope");
 			break;
 	}
 	if (native_thread) {
 #if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)
 		pthread_t tid;
 		if (!pthread_create(&tid, NULL, start, arg))
 			return((PRThread *) tid);
 		else
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -18,49 +18,49 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
  * This release (4.10.7) is backward compatible with the
  * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
  * 4.8.x, 4.9.x, 4.10, 4.10.1, 4.10.2, 4.10.3, 4.10.4,
- * 4.10.5, and 4.10.6 releases.
+ * 4.10.5, 4.10.6 and 4.10.7 releases.
  * It, of course, is compatible with itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
     "4.7.6",
     "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
     "4.8.6", "4.8.7", "4.8.8", "4.8.9",
     "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
     "4.9.6",
     "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4",
-    "4.10.5", "4.10.6",
+    "4.10.5", "4.10.6", "4.10.7",
     PR_VERSION
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.10.8",
+    "4.10.9",
     "4.11", "4.11.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);