Imported Upstream version 4.10.7 upstream/4.10.7
authorJohn L. Whiteman <john.l.whiteman@intel.com>
Thu, 21 Aug 2014 17:16:58 +0000 (10:16 -0700)
committerJohn L. Whiteman <john.l.whiteman@intel.com>
Thu, 21 Aug 2014 17:16:58 +0000 (10:16 -0700)
.hg_archival.txt
configure
configure.in
pr/include/pratom.h
pr/include/prbit.h
pr/include/prinit.h
pr/src/md/unix/unix.c
pr/src/threads/prtpd.c
pr/tests/vercheck.c

index 0d35c03..39eb26c 100644 (file)
@@ -1,4 +1,4 @@
 repo: a4b34919bf34db2ee22acbbc305693c8980b6dc6
-node: 476850821307d584874d040340f577dcde2aec38
+node: 0f03651116c5b34ba48b5a5cd31234303d9806b6
 branch: default
-tag: NSPR_4_10_6_RTM
+tag: NSPR_4_10_7_RTM
index 11f37c1..40d342c 100755 (executable)
--- a/configure
+++ b/configure
@@ -795,6 +795,7 @@ enable_debug_symbols
 enable_win32_target
 enable_symbian_target
 enable_debug_rtl
+enable_static_rtl
 enable_n32
 enable_x32
 enable_64bit
@@ -1455,6 +1456,7 @@ Optional Features:
   --enable-symbian-target=\$t
                           Specify symbian flavor. (WINSCW or GCCE)
   --enable-debug-rtl      Use the MSVC debug runtime library
+  --enable-static-rtl     Use the MSVC static runtime library
   --enable-n32            Enable n32 ABI support (IRIX only)
   --enable-x32            Enable x32 ABI support (x86_64 only)
   --enable-64bit          Enable 64-bit support (on certain platforms)
@@ -2487,7 +2489,7 @@ test -n "$target_alias" &&
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=6
+MOD_PATCH_VERSION=7
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
@@ -2576,18 +2578,19 @@ fi
   test -n "$CC" && break
 done
 
-    if test "$CC" = "cl"; then
-        echo 'main() { return 0; }' > dummy.c
-        ${CC} -o dummy dummy.c >/dev/null 2>&1
-        if test $? = 0; then
-            _WIN32_MSVC=1
-            CXX=$CC
-        else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $(CC) test failed.  Using normal feature tests" >&5
-$as_echo "$as_me: WARNING: $(CC) test failed.  Using normal feature tests" >&2;}
-        fi
-        rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
+    cat > conftest.c <<EOF
+#ifdef _MSC_VER
+COMPILER IS MSVC
+#endif
+EOF
+    read dummy <<EOF
+$($CC -E conftest.c 2>/dev/null | grep COMPILER)
+EOF
+    if test -n "$dummy"; then
+        _WIN32_MSVC=1
+        CXX=$CC
     fi
+    rm -f conftest.c
     ;;
 *-mks*)
     _WIN32_MSVC=1
@@ -2909,6 +2912,14 @@ if test "${enable_debug_rtl+set}" = set; then :
 fi
 
 
+# Check whether --enable-static-rtl was given.
+if test "${enable_static_rtl+set}" = set; then :
+  enableval=$enable_static_rtl;  if test "$enableval" = "yes"; then
+           USE_STATIC_RTL=1
+      fi
+fi
+
+
 # Check whether --enable-n32 was given.
 if test "${enable_n32+set}" = set; then :
   enableval=$enable_n32;  if test "$enableval" = "yes"; then
@@ -7098,8 +7109,6 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
     else
-        CC=cl
-        CXX=cl
         LD=link
         AR='lib -NOLOGO -OUT:"$@"'
         AR_FLAGS=
@@ -7186,9 +7195,17 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
         fi
 
         if test "$USE_DEBUG_RTL" = 1; then
-            CFLAGS="$CFLAGS -MDd"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MTd"
+            else
+                CFLAGS="$CFLAGS -MDd"
+            fi
         else
-            CFLAGS="$CFLAGS -MD"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MT"
+            else
+                CFLAGS="$CFLAGS -MD"
+            fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
@@ -7270,6 +7287,9 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
        else
            $as_echo "#define _X86_ 1" >>confdefs.h
 
+            if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
+                                                CFLAGS="$CFLAGS -arch:IA32"
+            fi
        fi
         ;;
     x86_64)
 ;;
 esac
 
-
-
 case "$target_os" in
 darwin*)
     _HAVE_PTHREADS=1
     ;;
 *)
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5
 $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
-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);
-        }
-        return 0;
-    }" > dummy.c ;
-    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS" 1>&5;
-    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS 2>&5;
-    _res=$? ;
-    rm -f dummy.c dummy${ac_exeext} ;
-    if test "$_res" = "0"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthreads_pthread_create=yes
+else
+  ac_cv_lib_pthreads_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
+  _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-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);
-        }
-        return 0;
-    }" > dummy.c ;
-    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS" 1>&5;
-    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS 2>&5;
-    _res=$? ;
-    rm -f dummy.c dummy${ac_exeext} ;
-    if test "$_res" = "0"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+  _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5
 $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
-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);
-        }
-        return 0;
-    }" > dummy.c ;
-    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS" 1>&5;
-    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS 2>&5;
-    _res=$? ;
-    rm -f dummy.c dummy${ac_exeext} ;
-    if test "$_res" = "0"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_c_r_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc" >&5
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_r_pthread_create=yes
+else
+  ac_cv_lib_c_r_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
+  _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc" >&5
 $as_echo_n "checking for pthread_create in -lc... " >&6; }
-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);
-        }
-        return 0;
-    }" > dummy.c ;
-    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5;
-    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5;
-    _res=$? ;
-    rm -f dummy.c dummy${ac_exeext} ;
-    if test "$_res" = "0"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        _HAVE_PTHREADS=1
+if ${ac_cv_lib_c_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_pthread_create=yes
+else
+  ac_cv_lib_c_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_create" >&5
+$as_echo "$ac_cv_lib_c_pthread_create" >&6; }
+if test "x$ac_cv_lib_c_pthread_create" = xyes; then :
+  _HAVE_PTHREADS=1
 
-    fi
+fi
 
 
-    fi
+fi
 
 
-    fi
+fi
 
 
-    fi
+fi
 
     ;;
 esac
index 9e9f1b1..fba01ae 100644 (file)
@@ -16,7 +16,7 @@ dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=6
+MOD_PATCH_VERSION=7
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
@@ -72,17 +72,19 @@ case "$target" in
     # Check to see if we are really running in a msvc environemnt
     _WIN32_MSVC=
     AC_CHECK_PROGS(CC, cl)
-    if test "$CC" = "cl"; then
-        echo 'main() { return 0; }' > dummy.c
-        ${CC} -o dummy dummy.c >/dev/null 2>&1
-        if test $? = 0; then
-            _WIN32_MSVC=1
-            CXX=$CC
-        else
-            AC_MSG_WARN([$(CC) test failed.  Using normal feature tests])
-        fi
-        rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
+    cat > conftest.c <<EOF
+#ifdef _MSC_VER
+COMPILER IS MSVC
+#endif
+EOF
+    read dummy <<EOF
+$($CC -E conftest.c 2>/dev/null | grep COMPILER)
+EOF
+    if test -n "$dummy"; then
+        _WIN32_MSVC=1
+        CXX=$CC
     fi
+    rm -f conftest.c
     ;;
 *-mks*)
     _WIN32_MSVC=1
@@ -388,6 +390,12 @@ AC_ARG_ENABLE(debug-rtl,
            USE_DEBUG_RTL=0
       fi ])
 
+AC_ARG_ENABLE(static-rtl,
+    [  --enable-static-rtl     Use the MSVC static runtime library],
+    [ if test "$enableval" = "yes"; then
+           USE_STATIC_RTL=1
+      fi ])
+
 AC_ARG_ENABLE(n32,
     [  --enable-n32            Enable n32 ABI support (IRIX only)],
     [ if test "$enableval" = "yes"; then
@@ -1913,8 +1921,6 @@ tools are selected during the Xcode/Developer Tools installation.])
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
     else
-        CC=cl
-        CXX=cl
         LD=link
         AR='lib -NOLOGO -OUT:"$@"'
         AR_FLAGS=
@@ -2004,9 +2010,17 @@ tools are selected during the Xcode/Developer Tools installation.])
         fi
 
         if test "$USE_DEBUG_RTL" = 1; then
-            CFLAGS="$CFLAGS -MDd"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MTd"
+            else
+                CFLAGS="$CFLAGS -MDd"
+            fi
         else
-            CFLAGS="$CFLAGS -MD"
+            if test -n "$USE_STATIC_RTL"; then
+                CFLAGS="$CFLAGS -MT"
+            else
+                CFLAGS="$CFLAGS -MD"
+            fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
@@ -2081,6 +2095,11 @@ tools are selected during the Xcode/Developer Tools installation.])
            AC_DEFINE(_AMD64_)
        else            
            AC_DEFINE(_X86_)
+            if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
+                dnl Visual C++ 2012 defaults to -arch:SSE2. Use -arch:IA32
+                dnl to avoid requiring SSE2.
+                CFLAGS="$CFLAGS -arch:IA32"
+            fi
        fi
         ;;
     x86_64)
@@ -2643,50 +2662,18 @@ fi
 ;;
 esac
 
-dnl
-dnl Apparently, some systems cannot properly check for the pthread
-dnl library unless <pthread.h> is included so we need to test
-dnl using it
-dnl
-dnl MOZ_CHECK_PTHREADS(lib, success, failure)
-AC_DEFUN(MOZ_CHECK_PTHREADS,
-[
-AC_MSG_CHECKING([for pthread_create in -l$1])
-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);
-        }
-        return 0;
-    }" > dummy.c ;
-    echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
-    ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
-    _res=$? ;
-    rm -f dummy.c dummy${ac_exeext} ;
-    if test "$_res" = "0"; then
-        AC_MSG_RESULT([yes])
-        [$2]
-    else
-        AC_MSG_RESULT([no])
-        [$3]
-    fi
-])
-
 case "$target_os" in
 darwin*)
     _HAVE_PTHREADS=1
     ;;
 *)
-    MOZ_CHECK_PTHREADS(pthreads,
+    AC_CHECK_LIB(pthreads, pthread_create,
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
-        MOZ_CHECK_PTHREADS(pthread,
+        AC_CHECK_LIB(pthread, pthread_create,
             _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
-            MOZ_CHECK_PTHREADS(c_r,
+            AC_CHECK_LIB(c_r, pthread_create,
                 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
-                MOZ_CHECK_PTHREADS(c,
+                AC_CHECK_LIB(c, pthread_create,
                     _HAVE_PTHREADS=1
                 )
             )
index 3b2fe5c..9dbe0fa 100644 (file)
@@ -81,10 +81,7 @@ NSPR_API(PRInt32)    PR_AtomicAdd(PRInt32 *ptr, PRInt32 val);
 #if defined(_WIN32) && !defined(_WIN32_WCE) && \
     (!defined(_MSC_VER) || (_MSC_VER >= 1310))
 
-long __cdecl _InterlockedIncrement(long volatile *Addend);
-long __cdecl _InterlockedDecrement(long volatile *Addend);
-long __cdecl _InterlockedExchange(long volatile *Target, long Value);
-long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value);
+#include <intrin.h>
 
 #ifdef _MSC_VER
 #pragma intrinsic(_InterlockedIncrement)
index de83750..0434fc6 100644 (file)
@@ -15,8 +15,7 @@ PR_BEGIN_EXTERN_C
 */
 #if defined(_WIN32) && (_MSC_VER >= 1300) && \
     (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM))
-  unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask);
-  unsigned char _BitScanReverse(unsigned long * Index, unsigned long Mask);
+# include <intrin.h>
 # pragma  intrinsic(_BitScanForward,_BitScanReverse)
   __forceinline static int __prBitScanForward32(unsigned int val)
   { 
index e77eaf1..a2b1365 100644 (file)
@@ -31,10 +31,10 @@ PR_BEGIN_EXTERN_C
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.10.6"
+#define PR_VERSION  "4.10.7"
 #define PR_VMAJOR   4
 #define PR_VMINOR   10
-#define PR_VPATCH   6
+#define PR_VPATCH   7
 #define PR_BETA     PR_FALSE
 
 /*
index 38f7be9..4f27b82 100644 (file)
 #include <poll.h>
 #endif
 
+#if defined(ANDROID)
+#include <android/api-level.h>
+#endif
+
 /* To get FIONREAD */
 #if defined(UNIXWARE)
 #include <sys/filio.h>
@@ -2709,8 +2713,8 @@ static void* _MD_Unix_mmap64(
 }  /* _MD_Unix_mmap64 */
 #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
 
-/* Android doesn't have mmap64. */
-#if defined(ANDROID)
+/* Android <= 19 doesn't have mmap64. */
+#if defined(ANDROID) && __ANDROID_API__ <= 19
 extern void *__mmap2(void *, size_t, int, int, int, size_t);
 
 #define ANDROID_PAGE_SIZE 4096
index decbc1c..0eb2a01 100644 (file)
@@ -130,8 +130,9 @@ PR_IMPLEMENT(PRStatus) PR_NewThreadPrivateIndex(
 ** destructor function and a non-NULL per-thread-private data value,
 ** the destructor function is invoked.
 **
-** This can return PR_FAILURE if index is invalid (ie., beyond the current
-** high water mark) or memory is insufficient to allocate an exanded vector.
+** This can return PR_FAILURE if index is invalid (ie., beyond the limit
+** on the TPD slots) or memory is insufficient to allocate an expanded
+** vector.
 */
 
 PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
@@ -139,11 +140,10 @@ PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
     PRThread *self = PR_GetCurrentThread();
 
     /*
-    ** The index being set might not have a sufficient vector in this
-    ** thread. But if the index has been allocated, it's okay to go
-    ** ahead and extend this one now.
+    ** To improve performance, we don't check if the index has been
+    ** allocated.
     */
-    if ((index >= _PR_TPD_LIMIT) || (index >= _pr_tpd_highwater))
+    if (index >= _PR_TPD_LIMIT)
     {
         PR_SetError(PR_TPD_RANGE_ERROR, 0);
         return PR_FAILURE;
@@ -152,6 +152,10 @@ PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void *priv)
     PR_ASSERT(((NULL == self->privateData) && (0 == self->tpdLength))
         || ((NULL != self->privateData) && (0 != self->tpdLength)));
 
+    /*
+    ** If this thread does not have a sufficient vector for the index
+    ** being set, go ahead and extend this vector now.
+    */
     if ((NULL == self->privateData) || (self->tpdLength <= index))
     {
         void *extension = PR_CALLOC(_pr_tpd_length * sizeof(void*));
index 256e5ed..f9f183b 100644 (file)
 #include <stdlib.h>
 
 /*
- * This release (4.10.6) is backward compatible with the
+ * 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, and
- * 4.10.5 releases.
+ * 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.
  * It, of course, is compatible with itself.
  */
 static char *compatible_version[] = {
@@ -39,7 +39,7 @@ static char *compatible_version[] = {
     "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.5", "4.10.6",
     PR_VERSION
 };
 
@@ -55,7 +55,7 @@ static char *incompatible_version[] = {
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.10.7",
+    "4.10.8",
     "4.11", "4.11.1",
     "10.0", "11.1", "12.14.20"
 };