update nspr to 4.8.4 beta 1 r=ted, wtc
authorBrad Lassey <blassey@mozilla.com>
Tue, 09 Feb 2010 09:55:23 -0500
changeset 38002 b16048173c47525deb9482707c2f5ebf4a51d770
parent 38001 19dbabe331ad317c784f9a500dae0724e4e4003f
child 38003 e1cda6f241e0ddafd22987b43d0e846308745de8
push idunknown
push userunknown
push dateunknown
reviewersted, wtc
milestone1.9.3a2pre
update nspr to 4.8.4 beta 1 r=ted, wtc
nsprpub/configure
nsprpub/configure.in
nsprpub/lib/ds/MANIFEST
nsprpub/lib/libc/include/MANIFEST
nsprpub/lib/libc/include/plresolv.h
nsprpub/lib/msgc/include/MANIFEST
nsprpub/pkg/solaris/SUNWprd/prototype
nsprpub/pr/include/MANIFEST
nsprpub/pr/include/md/_aix.h
nsprpub/pr/include/md/_win95.cfg
nsprpub/pr/include/md/_win95.h
nsprpub/pr/include/md/_winnt.cfg
nsprpub/pr/include/md/_winnt.h
nsprpub/pr/include/prlog.h
nsprpub/pr/src/io/prfdcach.c
nsprpub/pr/src/linking/prlink.c
nsprpub/pr/src/md/windows/w95sock.c
nsprpub/pr/src/misc/dtoa.c
nsprpub/pr/tests/dlltest.c
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -3368,17 +3368,17 @@ EOF
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
     PR_MD_CSRCS=darwin.c
     PR_MD_ASFILES=os_Darwin.s
 
     # Add Mac OS X support for loading CFM & CFBundle plugins
-    if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
+    if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
         cat >> confdefs.h <<\EOF
 #define XP_MACOSX 1
 EOF
 
         OS_TARGET=MacOSX
 
         if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
                         export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
@@ -4127,76 +4127,44 @@ EOF
 
     case "$target_cpu" in
     i*86)
 	if test -n "$USE_64"; then
 	    cat >> confdefs.h <<\EOF
 #define _AMD64_ 1
 EOF
 
-	    cat >> confdefs.h <<\EOF
-#define _M_AMD64 1
-EOF
-    
 	else		
 	    cat >> confdefs.h <<\EOF
 #define _X86_ 1
 EOF
 
 	fi
         ;;
-    alpha)
-	    cat >> confdefs.h <<\EOF
-#define _ALPHA_ 1
-EOF
-
-   	    ;;
-    mips)
-	    cat >> confdefs.h <<\EOF
-#define _MIPS_ 1
-EOF
-
-	    ;;
     x86_64)
 	    cat >> confdefs.h <<\EOF
 #define _AMD64_ 1
 EOF
 
-	    cat >> confdefs.h <<\EOF
-#define _M_AMD64 1
-EOF
-
 	    USE_64=1
 	    ;;
     ia64)
 	    cat >> confdefs.h <<\EOF
 #define _IA64_ 1
 EOF
 
-	    cat >> confdefs.h <<\EOF
-#define _M_IA64 1
-EOF
-
 	    USE_64=1
 	    ;;
     *)
 	    cat >> confdefs.h <<\EOF
 #define _CPU_ARCH_NOT_DEFINED 1
 EOF
 
 	    ;;
     esac
-
-    if test "$USE_64"; then
-        cat >> confdefs.h <<\EOF
-#define _WIN64 1
-EOF
-
-    fi
-
     ;;
 
 *-wince*|*-winmo*)
     cat >> confdefs.h <<\EOF
 #define XP_PC 1
 EOF
 
     cat >> confdefs.h <<\EOF
@@ -4503,27 +4471,27 @@ EOF
     if test -z "$GNU_CC"; then
         CC="$CC -std1 -ieee_with_inexact"
         if test "$OS_RELEASE" != "V2.0"; then
             CC="$CC -readonly_strings"
         fi
         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
         ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:4512: checking for machine/builtins.h" >&5
+echo "configure:4480: checking for machine/builtins.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4517 "configure"
+#line 4485 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5162,63 +5130,63 @@ if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 
 
 case $target in
 *-darwin*|*-beos*|*-os2*)
     ;;
 *)
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5171: checking for dlopen in -ldl" >&5
+echo "configure:5139: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5179 "configure"
+#line 5147 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
 LIBS="$ac_save_LIBS"
 
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5207: checking for dlfcn.h" >&5
+echo "configure:5175: checking for dlfcn.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5212 "configure"
+#line 5180 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -5241,23 +5209,23 @@ fi
     ;;
 esac
 
 
 
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:5250: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:5218: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 5256 "configure"
+#line 5224 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5265,17 +5233,17 @@ else
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 5274 "configure"
+#line 5242 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -5289,22 +5257,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
 for ac_func in lchown strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5298: checking for $ac_func" >&5
+echo "configure:5266: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5303 "configure"
+#line 5271 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char $ac_func();
@@ -5317,17 +5285,17 @@ int main() {
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
 $ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
@@ -5358,17 +5326,17 @@ if test "${enable_strip+set}" = set; the
 fi
 
 
 case "${target_os}" in
 hpux*)
 if test -z "$GNU_CC"; then
 
     echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
-echo "configure:5367: checking for +Olit support" >&5
+echo "configure:5335: checking for +Olit support" >&5
 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
                   ac_cv_hpux_usable_olit_option=no
         rm -f conftest*
         echo 'int main() { return 0; }' | cat > conftest.c
         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
         if test $? -eq 0; then
@@ -5397,17 +5365,17 @@ esac
 
 case "$target_os" in
 darwin*)
     _HAVE_PTHREADS=1
     ;;
 *)
     
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:5406: checking for pthread_create in -lpthreads" >&5
+echo "configure:5374: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5419,17 +5387,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:5428: checking for pthread_create in -lpthread" >&5
+echo "configure:5396: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5441,17 +5409,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:5450: checking for pthread_create in -lc_r" >&5
+echo "configure:5418: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5463,17 +5431,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:5472: checking for pthread_create in -lc" >&5
+echo "configure:5440: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5595,17 +5563,17 @@ EOF
     fi
 fi
 
 
 if test -n "$USE_PTHREADS"; then
       rm -f conftest*
    ac_cv_have_dash_pthread=no
    echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:5604: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:5572: checking whether ${CC-cc} accepts -pthread" >&5
    echo 'int main() { return 0; }' | cat > conftest.c
    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
    if test $? -eq 0; then
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
 	    freebsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
@@ -5618,17 +5586,17 @@ echo "configure:5604: checking whether $
 	fi
     fi
     rm -f conftest*
     echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6
 
 			    ac_cv_have_dash_pthreads=no
     if test "$ac_cv_have_dash_pthread" = "no"; then
 	    echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:5627: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:5595: checking whether ${CC-cc} accepts -pthreads" >&5
     	echo 'int main() { return 0; }' | cat > conftest.c
 	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
     	if test $? -eq 0; then
 	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 			    ac_cv_have_dash_pthreads=yes
 			    CFLAGS="$CFLAGS -pthreads"
 			    CXXFLAGS="$CXXFLAGS -pthreads"
 		    fi
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -1008,17 +1008,17 @@ case "$target" in
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
     PR_MD_CSRCS=darwin.c
     PR_MD_ASFILES=os_Darwin.s
 
     # Add Mac OS X support for loading CFM & CFBundle plugins
-    if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
+    if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
         AC_DEFINE(XP_MACOSX)
         OS_TARGET=MacOSX
 
         if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
             dnl Use the specified value
             export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
         elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
             dnl No value specified on the command line or in the environment,
@@ -1621,46 +1621,32 @@ tools are selected during the Xcode/Deve
 	    AC_MSG_ERROR([Missing OS_TARGET for ${target}.  Use --enable-win32-target to set.])
    	;;
     esac
 
     case "$target_cpu" in
     i*86)
 	if test -n "$USE_64"; then
 	    AC_DEFINE(_AMD64_)
-	    AC_DEFINE(_M_AMD64)    
 	else		
 	    AC_DEFINE(_X86_)
 	fi
         ;;
-    alpha)
-	    AC_DEFINE(_ALPHA_)
-   	    ;;
-    mips)
-	    AC_DEFINE(_MIPS_)
-	    ;;
     x86_64)
 	    AC_DEFINE(_AMD64_)
-	    AC_DEFINE(_M_AMD64)
 	    USE_64=1
 	    ;;
     ia64)
 	    AC_DEFINE(_IA64_)
-	    AC_DEFINE(_M_IA64)
 	    USE_64=1
 	    ;;
     *)
 	    AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
 	    ;;
     esac
-
-    if test "$USE_64"; then
-        AC_DEFINE(_WIN64)
-    fi
-
     ;;
 
 *-wince*|*-winmo*)
     AC_DEFINE(XP_PC)
     AC_DEFINE(WIN32)
     AC_DEFINE(WINCE)
     AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
 
deleted file mode 100644
--- a/nsprpub/lib/ds/MANIFEST
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# This is a list of local files which get copied to the mozilla:dist directory
-#
-
-plarenas.h
-plarena.h
-plhash.h
deleted file mode 100644
--- a/nsprpub/lib/libc/include/MANIFEST
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# This is a list of local files which get copied to the mozilla:dist directory
-#
-
-plbase64.h
-plerror.h
-plgetopt.h
-plresolv.h
-plstr.h
deleted file mode 100644
--- a/nsprpub/lib/libc/include/plresolv.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is the Netscape Portable Runtime (NSPR).
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998-2000
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/*
- * plresolv.h - asynchronous name resolution using DNS 
- */
-
-#ifndef _PLRESOLV_H_
-#define _PLRESOLV_H_
-
-/*
-** THIS IS WORK IN PROGRESS. DO NOT ATTEMPT TO USE ANY PORTION OF THIS
-** API UNTIL THIS MESSAGE NO LONGER EXISTS. IF YOU DO, THEN YOU SURRENDER
-** THE RIGHT TO COMPLAIN ABOUT ANY CONTENT.
-*/
-
-#if defined(XP_UNIX)
-
-#include <prtypes.h>
-#include <prnetdb.h>
-
-NSPR_BEGIN_EXTERN_C
-
-#define PL_RESOLVE_MAXHOSTENTBUF        1024
-#define PL_RESOLVE_DEFAULT_TIMEOUT      0
-
-/* Error return codes */
-#define PL_RESOLVE_OK            0
-#define PL_RESOLVE_EWINIT        1           /* Failed to initialize window */
-#define PL_RESOLVE_EMAKE         2           /* Failed to create request */
-#define PL_RESOLVE_ELAUNCH       3           /* Error launching Async request */
-#define PL_RESOLVE_ETIMEDOUT     4           /* Request timed-out */
-#define PL_RESOLVE_EINVAL        5           /* Invalid argument */
-#define PL_RESOLVE_EOVERFLOW     6           /* Buffer Overflow */
-#define PL_RESOLVE_EUNKNOWN      7           /* berserk error */
-
-/* ----------- Function Prototypes ----------------*/
-
-PR_EXTERN(PRStatus) PL_ResolveName(
-    const char *name, unsigned char *buf,
-    PRIntn bufsize, PRIntervalTime timeout,
-    PRHostEnt *hostentry, PRIntervalTime *ttl);
-
-PR_EXTERN(PRStatus) PL_ResolveAddr(
-    const PRNetAddr *address, unsigned char *buf,
-    PRIntn bufsize, PRIntervalTime timeout,
-    PRHostEnt *hostentry, PRIntervalTime *ttl);
-
-typedef struct PLResolveStats {
-    int re_errors;
-    int re_nu_look;
-    int re_na_look;
-    int re_replies;
-    int re_requests;
-    int re_resends;
-    int re_sent;
-    int re_timeouts;
-} PLResolveStats;
-
-typedef struct PLResoveInfo {
-    PRBool enabled;
-    PRUint32 numNameLookups;
-    PRUint32 numAddrLookups;
-    PRUint32 numLookupsInProgress;
-    PLResolveStats stats;
-} PLResoveInfo;
-
-PR_EXTERN(void) PL_ResolveInfo(PLResoveInfo *info);
-
-NSPR_END_EXTERN_C
-
-#endif /* defined(XP_UNIX) */
-
-#endif /* _PLRESOLV_H_ */
deleted file mode 100644
--- a/nsprpub/lib/msgc/include/MANIFEST
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# This is a list of local files which get copied to the mozilla:dist directory
-#
-
-prgc.h
--- a/nsprpub/pkg/solaris/SUNWprd/prototype
+++ b/nsprpub/pkg/solaris/SUNWprd/prototype
@@ -33,17 +33,17 @@
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 #
-#ident  "$Id: prototype,v 1.5 2008/10/20 22:38:46 christophe.ravel.bugs%sun.com Exp $"
+#ident  "$Id: prototype,v 1.6 2010/01/27 22:20:40 wtc%google.com Exp $"
 #
 # This required package information file contains a list of package contents.
 # The 'pkgmk' command uses this file to identify the contents of a package
 # and their location on the development machine when building the package.
 # Can be created via a text editor or through use of the 'pkgproto' command.
 
 #!search <pathname pathname ...>        # where to find pkg objects
 #!include <filename>                    # include another 'prototype' file
@@ -113,10 +113,9 @@ f none usr/include/mps/prtypes.h 0644 ro
 f none usr/include/mps/prvrsion.h 0644 root bin
 f none usr/include/mps/prwin16.h 0644 root bin
 f none usr/include/mps/plarenas.h 0644 root bin
 f none usr/include/mps/plarena.h 0644 root bin
 f none usr/include/mps/plbase64.h 0644 root bin
 f none usr/include/mps/plerror.h 0644 root bin
 f none usr/include/mps/plgetopt.h 0644 root bin
 f none usr/include/mps/plhash.h 0644 root bin
-f none usr/include/mps/plresolv.h 0644 root bin
 f none usr/include/mps/plstr.h 0644 root bin
deleted file mode 100644
--- a/nsprpub/pr/include/MANIFEST
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# This is a list of local files which get copied to the mozilla:dist directory
-#
-
-nspr.h
-pratom.h
-prbit.h
-prclist.h
-prcmon.h
-prcountr.h
-prcvar.h
-prdtoa.h
-prenv.h
-prerr.h
-prerror.h
-prinet.h
-prinit.h
-prinrval.h
-prio.h
-pripcsem.h
-prlink.h
-prlock.h
-prlog.h
-prlong.h
-prmem.h
-prmon.h
-prmwait.h
-prnetdb.h
-prolock.h
-prpdce.h
-prprf.h
-prproces.h
-prrng.h
-prrwlock.h
-prshm.h
-prshma.h
-prsystem.h
-prthread.h
-prtime.h
-prtpool.h
-prtrace.h
-prtypes.h
-prvrsion.h
-prwin16.h
-
-obsolete/protypes.h
-obsolete/prsem.h
-obsolete/probslet.h
-
-private/prpriv.h
-private/pprio.h
-private/pprthred.h
--- a/nsprpub/pr/include/md/_aix.h
+++ b/nsprpub/pr/include/md/_aix.h
@@ -72,18 +72,20 @@
 #define	USE_DLFCN
 #define _PR_HAVE_SOCKADDR_LEN
 #define _PR_POLL_AVAILABLE
 #define _PR_USE_POLL
 #define _PR_STAT_HAS_ONLY_ST_ATIME
 #ifdef _PR_INET6
 #define _PR_HAVE_INET_NTOP
 #define _PR_HAVE_GETHOSTBYNAME2
+#ifdef _AIX51 /* AIX 4.3.3 does not have AI_NUMERICHOST. */
 #define _PR_HAVE_GETADDRINFO
 #endif
+#endif
 #define _PR_HAVE_SYSV_SEMAPHORES
 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
 #define _PR_ACCEPT_INHERIT_NONBLOCK
 
 /* Timer operations */
 #if defined(AIX_TIMERS)
 extern PRIntervalTime _MD_AixGetInterval(void);
 #define _MD_GET_INTERVAL _MD_AixGetInterval
--- a/nsprpub/pr/include/md/_win95.cfg
+++ b/nsprpub/pr/include/md/_win95.cfg
@@ -101,61 +101,17 @@
 #define PR_ALIGN_OF_WORD	4
 #define PR_ALIGN_OF_DWORD	8
 #define PR_ALIGN_OF_DOUBLE  4
 #define PR_ALIGN_OF_POINTER 4
 
 #define PR_BYTES_PER_WORD_LOG2	2
 #define PR_BYTES_PER_DWORD_LOG2	3
 
-#elif defined(_ALPHA_)
-
-#define IS_LITTLE_ENDIAN 1
-#undef  IS_BIG_ENDIAN
-
-#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_BYTES_PER_WORD_LOG2  2
-#define PR_BYTES_PER_DWORD_LOG2 3
-
-#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
-
-#elif defined(_AMD64_)
+#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
@@ -194,17 +150,17 @@
 #define PR_ALIGN_OF_WORD	8
 #define PR_ALIGN_OF_DWORD	8
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 
 #define PR_BYTES_PER_WORD_LOG2	3
 #define PR_BYTES_PER_DWORD_LOG2	3
 
-#elif defined(_IA64_)
+#elif defined(_M_IA64) || defined(_IA64_)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
@@ -243,17 +199,17 @@
 #define PR_ALIGN_OF_WORD	8
 #define PR_ALIGN_OF_DWORD	8
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 
 #define PR_BYTES_PER_WORD_LOG2	3
 #define PR_BYTES_PER_DWORD_LOG2	3
 
-#elif defined(_ARM_)
+#elif defined(_M_ARM) || defined(_ARM_)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
--- a/nsprpub/pr/include/md/_win95.h
+++ b/nsprpub/pr/include/md/_win95.h
@@ -47,21 +47,21 @@
 /*
  * Internal configuration macros
  */
 
 #define PR_LINKER_ARCH      "win32"
 #define _PR_SI_SYSNAME        "WIN95"
 #if defined(_M_IX86) || defined(_X86_)
 #define _PR_SI_ARCHITECTURE   "x86"
-#elif defined(_AMD64_)
+#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
 #define _PR_SI_ARCHITECTURE   "x86-64"
-#elif defined(_IA64_)
+#elif defined(_M_IA64) || defined(_IA64_)
 #define _PR_SI_ARCHITECTURE   "ia64"
-#elif defined(_ARM_)
+#elif defined(_M_ARM) || defined(_ARM_)
 #define _PR_SI_ARCHITECTURE   "arm"
 #else
 #error unknown processor architecture
 #endif
 
 #define HAVE_DLL
 #undef  HAVE_THREAD_AFFINITY
 #define _PR_HAVE_GETADDRINFO
--- a/nsprpub/pr/include/md/_winnt.cfg
+++ b/nsprpub/pr/include/md/_winnt.cfg
@@ -95,61 +95,17 @@
 #define PR_ALIGN_OF_WORD	4
 #define PR_ALIGN_OF_DWORD	8
 #define PR_ALIGN_OF_DOUBLE  4
 #define PR_ALIGN_OF_POINTER 4
 
 #define PR_BYTES_PER_WORD_LOG2	2
 #define PR_BYTES_PER_DWORD_LOG2	2
 
-#elif defined(_ALPHA_)
-
-#define IS_LITTLE_ENDIAN 1
-#undef  IS_BIG_ENDIAN
-
-#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_BYTES_PER_WORD_LOG2  2
-#define PR_BYTES_PER_DWORD_LOG2 3
-
-#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
-
-#elif defined(_AMD64_)
+#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
@@ -188,17 +144,17 @@
 #define PR_ALIGN_OF_WORD    8
 #define PR_ALIGN_OF_DWORD   8
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 
 #define PR_BYTES_PER_WORD_LOG2	3
 #define PR_BYTES_PER_DWORD_LOG2	3
 
-#elif defined(_IA64_)
+#elif defined(_M_IA64) || defined(_IA64_)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
--- a/nsprpub/pr/include/md/_winnt.h
+++ b/nsprpub/pr/include/md/_winnt.h
@@ -61,19 +61,19 @@
 /*
  * Internal configuration macros
  */
 
 #define PR_LINKER_ARCH      "win32"
 #define _PR_SI_SYSNAME        "WINNT"
 #if defined(_M_IX86) || defined(_X86_)
 #define _PR_SI_ARCHITECTURE   "x86"
-#elif defined(_AMD64_)
+#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
 #define _PR_SI_ARCHITECTURE   "x86-64"
-#elif defined(_IA64_)
+#elif defined(_M_IA64) || defined(_IA64_)
 #define _PR_SI_ARCHITECTURE   "ia64"
 #else
 #error unknown processor architecture
 #endif
 
 #define HAVE_DLL
 #define HAVE_CUSTOM_USER_THREADS
 #define HAVE_THREAD_AFFINITY
--- a/nsprpub/pr/include/prlog.h
+++ b/nsprpub/pr/include/prlog.h
@@ -184,16 +184,18 @@ NSPR_API(void) PR_SetLogBuffering(PRIntn
 */
 NSPR_API(void) PR_LogPrint(const char *fmt, ...);
 
 /*
 ** Flush the log to its file.
 */
 NSPR_API(void) PR_LogFlush(void);
 
+NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);
+
 #if defined(DEBUG) || defined(FORCE_PR_LOG)
 #define PR_LOGGING 1
 
 #define PR_LOG_TEST(_module,_level) \
     ((_module)->level >= (_level))
 
 /*
 ** Log something.
@@ -228,17 +230,16 @@ NSPR_API(void) PR_LogFlush(void);
 #define PR_LOG_END(module,level,args)
 #define PR_LOG_DEFINE(_name)    NULL
 #endif /* PR_LOGGING */
 
 #endif /* NO_NSPR_10_SUPPORT */
 
 #if defined(DEBUG) || defined(FORCE_PR_ASSERT)
 
-NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);
 #define PR_ASSERT(_expr) \
     ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
 
 #define PR_NOT_REACHED(_reasonStr) \
     PR_Assert(_reasonStr,__FILE__,__LINE__)
 
 #else
 
--- a/nsprpub/pr/src/io/prfdcach.c
+++ b/nsprpub/pr/src/io/prfdcach.c
@@ -301,19 +301,19 @@ void _PR_CleanupFdCache(void)
     PRStackElem *pop;
 
     for (fd = _pr_fd_cache.head; fd != NULL; fd = next)
     {
         next = fd->higher;
         PR_DELETE(fd->secret);
         PR_DELETE(fd);
     }
-    _pr_fd_cache.head = NULL;
-    _pr_fd_cache.tail = NULL;
-    _pr_fd_cache.count = 0;
+    _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);
     }
--- a/nsprpub/pr/src/linking/prlink.c
+++ b/nsprpub/pr/src/linking/prlink.c
@@ -69,16 +69,19 @@
 #ifndef RTLD_GLOBAL
 #define RTLD_GLOBAL 0
 #endif
 #ifndef RTLD_LOCAL
 #define RTLD_LOCAL 0
 #endif
 #ifdef AIX
 #include <sys/ldr.h>
+#ifndef L_IGNOREUNLOAD /* AIX 4.3.3 does not have L_IGNOREUNLOAD. */
+#define L_IGNOREUNLOAD 0x10000000
+#endif
 #endif
 #ifdef OSF1
 #include <loader.h>
 #include <rld_interface.h>
 #endif
 #elif defined(USE_HPSHL)
 #include <dl.h>
 #elif defined(USE_MACH_DYLD)
--- a/nsprpub/pr/src/md/windows/w95sock.c
+++ b/nsprpub/pr/src/md/windows/w95sock.c
@@ -67,17 +67,17 @@ static PRInt32 socket_io_wait(
 
 typedef enum _WSA_COMPATIBILITY_BEHAVIOR_ID {
     WsaBehaviorAll = 0,
     WsaBehaviorReceiveBuffering,
     WsaBehaviorAutoTuning
 } WSA_COMPATIBILITY_BEHAVIOR_ID, *PWSA_COMPATIBILITY_BEHAVIOR_ID;
 
 /* from sdkddkver.h */
-#define NTDDI_LONGHORN                      0x06000000
+#define NTDDI_WIN6              0x06000000  /* Windows Vista */
 
 /* from winsock2.h */
 #define WSAEVENT                HANDLE
 
 #define WSAOVERLAPPED           OVERLAPPED
 typedef struct _OVERLAPPED *    LPWSAOVERLAPPED;
 
 typedef void (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(
@@ -170,17 +170,17 @@ PROsfd
     if ((af == AF_INET || af == AF_INET6) && 
         type == SOCK_STREAM && socketSetCompatMode)
     {
         WSA_COMPATIBILITY_MODE mode;
         char dummy[4];
         int ret_dummy;
 
         mode.BehaviorId = WsaBehaviorAutoTuning;
-        mode.TargetOsVersion = NTDDI_LONGHORN;
+        mode.TargetOsVersion = NTDDI_WIN6;
         if (wsaioctlProc(sock, SIO_SET_COMPATIBILITY_MODE,  
                          (char *)&mode, sizeof(mode),
                          dummy, 4, &ret_dummy, 0, NULL) == SOCKET_ERROR)
         {
             int err = WSAGetLastError();
             PR_LOG(_pr_io_lm, PR_LOG_DEBUG, ("WSAIoctl() failed with %d", err));
 
             /* SIO_SET_COMPATIBILITY_MODE may not be supported.
--- a/nsprpub/pr/src/misc/dtoa.c
+++ b/nsprpub/pr/src/misc/dtoa.c
@@ -2079,17 +2079,17 @@ gethex( CONST char **sp, U *rvp, int rou
 	/* The next two lines ignore swap of low- and high-order 2 bytes. */
 	/* word0(rvp) = (b->x[1] & ~0x800000) | ((e + 129 + 55) << 23); */
 	/* word1(rvp) = b->x[0]; */
 	word0(rvp) = ((b->x[1] & ~0x800000) >> 16) | ((e + 129 + 55) << 7) | (b->x[1] << 16);
 	word1(rvp) = (b->x[0] >> 16) | (b->x[0] << 16);
 #endif
 	Bfree(b);
 	}
-#endif /*}!NO_HEX_FP*/
+#endif /*!NO_HEX_FP}*/
 
  static int
 #ifdef KR_headers
 dshift(b, p2) Bigint *b; int p2;
 #else
 dshift(Bigint *b, int p2)
 #endif
 {
@@ -2126,17 +2126,23 @@ quorem
 	if (b->wds < n)
 		return 0;
 	sx = S->x;
 	sxe = sx + --n;
 	bx = b->x;
 	bxe = bx + n;
 	q = *bxe / (*sxe + 1);	/* ensure q <= true quotient */
 #ifdef DEBUG
+#ifdef NO_STRTOD_BIGCOMP
 	/*debug*/ if (q > 9)
+#else
+	/* An oversized q is possible when quorem is called from bigcomp and */
+	/* the input is near, e.g., twice the smallest denormalized number. */
+	/*debug*/ if (q > 15)
+#endif
 	/*debug*/	Bug("oversized quotient in quorem");
 #endif
 	if (q) {
 		borrow = 0;
 		carry = 0;
 		do {
 #ifdef ULLong
 			ys = *sx++ * (ULLong)q + carry;
@@ -2212,18 +2218,39 @@ quorem
 			while(--bxe > bx && !*bxe)
 				--n;
 			b->wds = n;
 			}
 		}
 	return q;
 	}
 
+#if defined(Avoid_Underflow) || !defined(NO_STRTOD_BIGCOMP) /*{*/
+ static double
+sulp
+#ifdef KR_headers
+	(x, bc) U *x; BCinfo *bc;
+#else
+	(U *x, BCinfo *bc)
+#endif
+{
+	U u;
+	double rv;
+	int i;
+
+	rv = ulp(x);
+	if (!bc->scale || (i = 2*P + 1 - ((word0(x) & Exp_mask) >> Exp_shift)) <= 0)
+		return rv; /* Is there an example where i <= 0 ? */
+	word0(&u) = Exp_1 + (i << Exp_shift);
+	word1(&u) = 0;
+	return rv * u.d;
+	}
+#endif /*}*/
+
 #ifndef NO_STRTOD_BIGCOMP
-
  static void
 bigcomp
 #ifdef KR_headers
 	(rv, s0, bc)
 	U *rv; CONST char *s0; BCinfo *bc;
 #else
 	(U *rv, CONST char *s0, BCinfo *bc)
 #endif
@@ -2372,44 +2399,54 @@ bigcomp
 		else if (dd > 0) {
 			if (bc->rounding == 0) {
 				if (dsign)
 					goto rethi1;
 				goto ret1;
 				}
 			if (!dsign)
 				goto rethi1;
-			dval(rv) += 2.*ulp(rv);
+			dval(rv) += 2.*sulp(rv,bc);
 			}
 		else {
 			bc->inexact = 0;
 			if (dsign)
 				goto rethi1;
 			}
 		}
 	else
 #endif
 	if (speccase) {
 		if (dd <= 0)
 			rv->d = 0.;
 		}
 	else if (dd < 0) {
 		if (!dsign)	/* does not happen for round-near */
 retlow1:
-			dval(rv) -= ulp(rv);
+			dval(rv) -= sulp(rv,bc);
 		}
 	else if (dd > 0) {
 		if (dsign) {
  rethi1:
-			dval(rv) += ulp(rv);
+			dval(rv) += sulp(rv,bc);
 			}
 		}
 	else {
 		/* Exact half-way case:  apply round-even rule. */
-		if (word1(rv) & 1) {
+		if ((j = ((word0(rv) & Exp_mask) >> Exp_shift) - bc->scale) <= 0) {
+			i = 1 - j;
+			if (i <= 31) {
+				if (word1(rv) & (0x1 << i))
+					goto odd;
+				}
+			else if (word0(rv) & (0x1 << (i-32)))
+				goto odd;
+			}
+		else if (word1(rv) & 1) {
+ odd:
 			if (dsign)
 				goto rethi1;
 			goto retlow1;
 			}
 		}
 
 #ifdef Honor_FLT_ROUNDS
  ret1:
@@ -2422,24 +2459,27 @@ retlow1:
 strtod
 #ifdef KR_headers
 	(s00, se) CONST char *s00; char **se;
 #else
 	(CONST char *s00, char **se)
 #endif
 {
 	int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1;
-	int esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
+	int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign;
 	CONST char *s, *s0, *s1;
 	double aadj, aadj1;
 	Long L;
 	U aadj2, adj, rv, rv0;
 	ULong y, z;
 	BCinfo bc;
 	Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
+#ifdef Avoid_Underflow
+	ULong Lsb, Lsb1;
+#endif
 #ifdef SET_INEXACT
 	int oldinexact;
 #endif
 #ifdef Honor_FLT_ROUNDS /*{*/
 #ifdef Trust_FLT_ROUNDS /*{{ only define this if FLT_ROUNDS really works! */
 	bc.rounding = Flt_Rounds;
 #else /*}{*/
 	bc.rounding = 1;
@@ -2449,17 +2489,17 @@ strtod
 	  case FE_DOWNWARD:	bc.rounding = 3;
 	  }
 #endif /*}}*/
 #endif /*}*/
 #ifdef USE_LOCALE
 	CONST char *s2;
 #endif
 
-	sign = nz0 = nz = bc.dplen = bc.uflchk = 0;
+	sign = nz0 = nz1 = nz = bc.dplen = bc.uflchk = 0;
 	dval(&rv) = 0.;
 	for(s = s00;;s++) switch(*s) {
 		case '-':
 			sign = 1;
 			/* no break */
 		case '+':
 			if (*++s)
 				goto break2;
@@ -2499,16 +2539,18 @@ strtod
 	y = z = 0;
 	for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
 		if (nd < 9)
 			y = 10*y + c - '0';
 		else if (nd < 16)
 			z = 10*z + c - '0';
 	nd0 = nd;
 	bc.dp0 = bc.dp1 = s - s0;
+	for(s1 = s; s1 > s0 && *--s1 == '0'; )
+		++nz1;
 #ifdef USE_LOCALE
 	s1 = localeconv()->decimal_point;
 	if (c == *s1) {
 		c = '.';
 		if (*++s1) {
 			s2 = s;
 			for(;;) {
 				if (*++s2 != *s1) {
@@ -2547,17 +2589,17 @@ strtod
 					if (nd++ < 9)
 						y *= 10;
 					else if (nd <= DBL_DIG + 1)
 						z *= 10;
 				if (nd++ < 9)
 					y = 10*y + c;
 				else if (nd <= DBL_DIG + 1)
 					z = 10*z + c;
-				nz = 0;
+				nz = nz1 = 0;
 				}
 			}
 		}
  dig_done:
 	e = 0;
 	if (c == 'e' || c == 'E') {
 		if (!nd && !nz && !nz0) {
 			goto ret0;
@@ -2812,16 +2854,18 @@ strtod
 				bc.scale = 2*P;
 			for(j = 0; e1 > 0; j++, e1 >>= 1)
 				if (e1 & 1)
 					dval(&rv) *= tinytens[j];
 			if (bc.scale && (j = 2*P + 1 - ((word0(&rv) & Exp_mask)
 						>> Exp_shift)) > 0) {
 				/* scaled rv is denormal; clear j low bits */
 				if (j >= 32) {
+					if (j > 54)
+						goto undfl;
 					word1(&rv) = 0;
 					if (j >= 53)
 					 word0(&rv) = (P+2)*Exp_msk1;
 					else
 					 word0(&rv) &= 0xffffffff << (j-32);
 					}
 				else
 					word1(&rv) &= 0xffffffff << j;
@@ -2855,30 +2899,30 @@ strtod
 #endif
 			}
 		}
 
 	/* Now the hard part -- adjusting rv to the correct value.*/
 
 	/* Put digits into bd: true value = bd * 10^e */
 
-	bc.nd = nd;
+	bc.nd = nd - nz1;
 #ifndef NO_STRTOD_BIGCOMP
 	bc.nd0 = nd0;	/* Only needed if nd > strtod_diglim, but done here */
 			/* to silence an erroneous warning about bc.nd0 */
 			/* possibly not being initialized. */
 	if (nd > strtod_diglim) {
 		/* ASSERT(strtod_diglim >= 18); 18 == one more than the */
 		/* minimum number of decimal digits to distinguish double values */
 		/* in IEEE arithmetic. */
 		i = j = 18;
 		if (i > nd0)
 			j += bc.dplen;
 		for(;;) {
-			if (--j <= bc.dp1 && j >= bc.dp0)
+			if (--j < bc.dp1 && j >= bc.dp0)
 				j = bc.dp0 - 1;
 			if (s0[j] != '0')
 				break;
 			--i;
 			}
 		e += nd - i;
 		nd = i;
 		if (nd0 > nd)
@@ -2913,22 +2957,31 @@ strtod
 		else
 			bd2 -= bbe;
 		bs2 = bb2;
 #ifdef Honor_FLT_ROUNDS
 		if (bc.rounding != 1)
 			bs2++;
 #endif
 #ifdef Avoid_Underflow
+		Lsb = LSB;
+		Lsb1 = 0;
 		j = bbe - bc.scale;
 		i = j + bbbits - 1;	/* logb(rv) */
-		if (i < Emin)	/* denormal */
-			j += P - Emin;
-		else
-			j = P + 1 - bbbits;
+		j = P + 1 - bbbits;
+		if (i < Emin) {	/* denormal */
+			i = Emin - i;
+			j -= i;
+			if (i < 32)
+				Lsb <<= i;
+			else if (i < 52)
+				Lsb1 = Lsb << (i-32);
+			else
+				Lsb1 = Exp_mask;
+			}
 #else /*Avoid_Underflow*/
 #ifdef Sudden_Underflow
 #ifdef IBM
 		j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3);
 #else
 		j = P + 1 - bbbits;
 #endif
 #else /*Sudden_Underflow*/
@@ -2966,34 +3019,31 @@ strtod
 		if (bd2 > 0)
 			bd = lshift(bd, bd2);
 		if (bs2 > 0)
 			bs = lshift(bs, bs2);
 		delta = diff(bb, bd);
 		bc.dsign = delta->sign;
 		delta->sign = 0;
 		i = cmp(delta, bs);
-#ifndef NO_STRTOD_BIGCOMP
+#ifndef NO_STRTOD_BIGCOMP /*{*/
 		if (bc.nd > nd && i <= 0) {
 			if (bc.dsign)
 				break;	/* Must use bigcomp(). */
 #ifdef Honor_FLT_ROUNDS
 			if (bc.rounding != 1) {
 				if (i < 0)
 					break;
 				}
 			else
 #endif
-				{
-				bc.nd = nd;
 				i = -1;	/* Discarded digits make delta smaller. */
-				}
 			}
-#endif
-#ifdef Honor_FLT_ROUNDS
+#endif /*}*/
+#ifdef Honor_FLT_ROUNDS /*{*/
 		if (bc.rounding != 1) {
 			if (i < 0) {
 				/* Error is less than an ulp */
 				if (!delta->x[0] && delta->wds <= 1) {
 					/* exact */
 #ifdef SET_INEXACT
 					bc.inexact = 0;
 #endif
@@ -3017,88 +3067,88 @@ strtod
 #endif
 						  {
 						  delta = lshift(delta,Log2P);
 						  if (cmp(delta, bs) <= 0)
 							adj.d = -0.5;
 						  }
 						}
  apply_adj:
-#ifdef Avoid_Underflow
+#ifdef Avoid_Underflow /*{*/
 					if (bc.scale && (y = word0(&rv) & Exp_mask)
 						<= 2*P*Exp_msk1)
 					  word0(&adj) += (2*P+1)*Exp_msk1 - y;
 #else
 #ifdef Sudden_Underflow
 					if ((word0(&rv) & Exp_mask) <=
 							P*Exp_msk1) {
 						word0(&rv) += P*Exp_msk1;
 						dval(&rv) += adj.d*ulp(dval(&rv));
 						word0(&rv) -= P*Exp_msk1;
 						}
 					else
 #endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
+#endif /*Avoid_Underflow}*/
 					dval(&rv) += adj.d*ulp(&rv);
 					}
 				break;
 				}
 			adj.d = ratio(delta, bs);
 			if (adj.d < 1.)
 				adj.d = 1.;
 			if (adj.d <= 0x7ffffffe) {
 				/* adj = rounding ? ceil(adj) : floor(adj); */
 				y = adj.d;
 				if (y != adj.d) {
 					if (!((bc.rounding>>1) ^ bc.dsign))
 						y++;
 					adj.d = y;
 					}
 				}
-#ifdef Avoid_Underflow
+#ifdef Avoid_Underflow /*{*/
 			if (bc.scale && (y = word0(&rv) & Exp_mask) <= 2*P*Exp_msk1)
 				word0(&adj) += (2*P+1)*Exp_msk1 - y;
 #else
 #ifdef Sudden_Underflow
 			if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) {
 				word0(&rv) += P*Exp_msk1;
 				adj.d *= ulp(dval(&rv));
 				if (bc.dsign)
 					dval(&rv) += adj.d;
 				else
 					dval(&rv) -= adj.d;
 				word0(&rv) -= P*Exp_msk1;
 				goto cont;
 				}
 #endif /*Sudden_Underflow*/
-#endif /*Avoid_Underflow*/
+#endif /*Avoid_Underflow}*/
 			adj.d *= ulp(&rv);
 			if (bc.dsign) {
 				if (word0(&rv) == Big0 && word1(&rv) == Big1)
-					goto ovfl;
+					goto ovflfree;
 				dval(&rv) += adj.d;
 				}
 			else
 				dval(&rv) -= adj.d;
 			goto cont;
 			}
-#endif /*Honor_FLT_ROUNDS*/
+#endif /*}Honor_FLT_ROUNDS*/
 
 		if (i < 0) {
 			/* Error is less than half an ulp -- check for
 			 * special case of mantissa a power of two.
 			 */
 			if (bc.dsign || word1(&rv) || word0(&rv) & Bndry_mask
-#ifdef IEEE_Arith
+#ifdef IEEE_Arith /*{*/
 #ifdef Avoid_Underflow
 			 || (word0(&rv) & Exp_mask) <= (2*P+1)*Exp_msk1
 #else
 			 || (word0(&rv) & Exp_mask) <= Exp_msk1
 #endif
-#endif
+#endif /*}*/
 				) {
 #ifdef SET_INEXACT
 				if (!delta->x[0] && delta->wds <= 1)
 					bc.inexact = 0;
 #endif
 				break;
 				}
 			if (!delta->x[0] && delta->wds <= 1) {
@@ -3179,28 +3229,49 @@ strtod
 #endif /*Avoid_Underflow*/
 				L = (word0(&rv) & Exp_mask) - Exp_msk1;
 #endif /*Sudden_Underflow}}*/
 				word0(&rv) = L | Bndry_mask1;
 				word1(&rv) = 0xffffffff;
 #ifdef IBM
 				goto cont;
 #else
+#ifndef NO_STRTOD_BIGCOMP
+				if (bc.nd > nd)
+					goto cont;
+#endif
 				break;
 #endif
 				}
 #ifndef ROUND_BIASED
+#ifdef Avoid_Underflow
+			if (Lsb1) {
+				if (!(word0(&rv) & Lsb1))
+					break;
+				}
+			else if (!(word1(&rv) & Lsb))
+				break;
+#else
 			if (!(word1(&rv) & LSB))
 				break;
 #endif
+#endif
 			if (bc.dsign)
+#ifdef Avoid_Underflow
+				dval(&rv) += sulp(&rv, &bc);
+#else
 				dval(&rv) += ulp(&rv);
+#endif
 #ifndef ROUND_BIASED
 			else {
+#ifdef Avoid_Underflow
+				dval(&rv) -= sulp(&rv, &bc);
+#else
 				dval(&rv) -= ulp(&rv);
+#endif
 #ifndef Sudden_Underflow
 				if (!dval(&rv)) {
 					if (bc.nd >nd) {
 						bc.uflchk = 1;
 						break;
 						}
 					goto undfl;
 					}
@@ -3262,18 +3333,27 @@ strtod
 
 		if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
 			dval(&rv0) = dval(&rv);
 			word0(&rv) -= P*Exp_msk1;
 			adj.d = aadj1 * ulp(&rv);
 			dval(&rv) += adj.d;
 			if ((word0(&rv) & Exp_mask) >=
 					Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
-				if (word0(&rv0) == Big0 && word1(&rv0) == Big1)
+				if (word0(&rv0) == Big0 && word1(&rv0) == Big1) {
+#ifdef Honor_FLT_ROUNDS
+ ovflfree:
+#endif
+					Bfree(bb);
+					Bfree(bd);
+					Bfree(bs);
+					Bfree(bd0);
+					Bfree(delta);
 					goto ovfl;
+					}
 				word0(&rv) = Big0;
 				word1(&rv) = Big1;
 				goto cont;
 				}
 			else
 				word0(&rv) += P*Exp_msk1;
 			}
 		else {
@@ -3283,19 +3363,33 @@ strtod
 					if ((z = aadj) <= 0)
 						z = 1;
 					aadj = z;
 					aadj1 = bc.dsign ? aadj : -aadj;
 					}
 				dval(&aadj2) = aadj1;
 				word0(&aadj2) += (2*P+1)*Exp_msk1 - y;
 				aadj1 = dval(&aadj2);
+				adj.d = aadj1 * ulp(&rv);
+				dval(&rv) += adj.d;
+				if (rv.d == 0.)
+#ifdef NO_STRTOD_BIGCOMP
+					goto undfl;
+#else
+					{
+					if (bc.nd > nd)
+						bc.dsign = 1;
+					break;
+					}
+#endif
 				}
-			adj.d = aadj1 * ulp(&rv);
-			dval(&rv) += adj.d;
+			else {
+				adj.d = aadj1 * ulp(&rv);
+				dval(&rv) += adj.d;
+				}
 #else
 #ifdef Sudden_Underflow
 			if ((word0(&rv) & Exp_mask) <= P*Exp_msk1) {
 				dval(&rv0) = dval(&rv);
 				word0(&rv) += P*Exp_msk1;
 				adj.d = aadj1 * ulp(&rv);
 				dval(&rv) += adj.d;
 #ifdef IBM
@@ -3368,18 +3462,20 @@ strtod
 		Bfree(delta);
 		}
 	Bfree(bb);
 	Bfree(bd);
 	Bfree(bs);
 	Bfree(bd0);
 	Bfree(delta);
 #ifndef NO_STRTOD_BIGCOMP
-	if (bc.nd > nd)
+	if (bc.nd > nd && bc.dsign) {
+		bc.e0 += nz1;
 		bigcomp(&rv, s0, &bc);
+		}
 #endif
 #ifdef SET_INEXACT
 	if (bc.inexact) {
 		if (!oldinexact) {
 			word0(&rv0) = Exp_1 + (70 << Exp_shift);
 			word1(&rv0) = 0;
 			dval(&rv0) += 1.;
 			}
--- a/nsprpub/pr/tests/dlltest.c
+++ b/nsprpub/pr/tests/dlltest.c
@@ -93,17 +93,18 @@ int main(int argc, char** argv)
      */
 
     libName = PR_GetLibraryName("dll", "my");
     if (debug_mode) printf("Loading library %s\n", libName);
     lib = PR_LoadLibrary(libName);
     PR_FreeLibraryName(libName);
     if (lib == NULL) {
         PRInt32 textLength = PR_GetErrorTextLength();
-        char *text = (char*)PR_MALLOC(textLength);
+        char *text = (char*)PR_MALLOC(textLength + 1);
+        text[0] = '\0';
         (void)PR_GetErrorText(text);
         fprintf(
             stderr, "PR_LoadLibrary failed (%d, %d, %s)\n",
             PR_GetError(), PR_GetOSError(), text);
         if (!debug_mode) failed_already=1;
     }
     getFcn = (GetFcnType) PR_FindSymbol(lib, "My_GetValue");
     setFcn = (SetFcnType) PR_FindFunctionSymbol(lib, "My_SetValue");