From 50f657b9c7da066427a9583d6f2817e078c69095 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Fri, 22 Feb 2019 21:39:39 +0800 Subject: [PATCH] nspr: update nspr to hg rev 753fe0f7964c --- nsprpub/configure | 19 ++----------------- nsprpub/configure.in | 18 +----------------- nsprpub/lib/ds/plvrsion.c | 2 +- nsprpub/lib/libc/src/plvrsion.c | 2 +- nsprpub/lib/prstreams/plvrsion.c | 2 +- nsprpub/patches/nspr-ws2_32.patch | 27 +++++++++++++++++++++++++++ nsprpub/pr/include/md/_win32_errors.h | 2 +- nsprpub/pr/include/prbit.h | 8 +++++--- nsprpub/pr/include/prinit.h | 6 +++--- nsprpub/pr/src/io/pripv6.c | 2 +- nsprpub/pr/src/md/windows/w95sock.c | 6 ++++++ nsprpub/pr/src/prvrsion.c | 2 +- nsprpub/pr/tests/abstract.c | 2 +- nsprpub/pr/tests/vercheck.c | 6 +++--- 14 files changed, 54 insertions(+), 50 deletions(-) create mode 100644 nsprpub/patches/nspr-ws2_32.patch diff --git a/nsprpub/configure b/nsprpub/configure index ce2543ed76..0d81aac00a 100644 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -783,7 +783,6 @@ with_android_ndk with_android_toolchain with_android_version with_android_platform -with_gonk with_dist_prefix with_dist_bindir with_dist_includedir @@ -873,6 +872,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' + includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1484,7 +1484,6 @@ Optional Packages: Android platform version, default 5 for arm, 9 for x86/mips --with-android-platform=DIR location of platform dir - --with-gonk=DIR location of gonk dir --with-dist-prefix=DIST_PREFIX place build files in DIST_PREFIX dist --with-dist-bindir=DIR build execuatables in DIR DIST_PREFIX/bin @@ -2488,7 +2487,7 @@ test -n "$target_alias" && program_prefix=${target_alias}- MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=20 +MOD_MINOR_VERSION=21 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= @@ -2656,19 +2655,6 @@ mipsel-*android*) ;; esac - - -# Check whether --with-gonk was given. -if test "${with_gonk+set}" = set; then : - withval=$with_gonk; gonkdir=$withval -fi - - -if test -n "$gonkdir" ; then - - $as_echo "#define ANDROID 1" >>confdefs.h - -else case "$target" in *-android*|*-linuxandroid*) if test -z "$android_ndk" ; then @@ -2754,7 +2740,6 @@ $as_echo "$android_platform" >&6; } ;; esac -fi dist_prefix='${MOD_DEPTH}/dist' dist_bindir='${dist_prefix}/bin' diff --git a/nsprpub/configure.in b/nsprpub/configure.in index cbd22b42e8..9ff70f3589 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -15,7 +15,7 @@ dnl ======================================================== dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=20 +MOD_MINOR_VERSION=21 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= @@ -147,21 +147,6 @@ mipsel-*android*) ;; esac -dnl ======================================================== -dnl = Gonk is a fork of Android used for Mozilla's B2G project. -dnl = Configuration is done largely by the top level config -dnl = and the specified gonk directory doesn't matter here. -dnl ======================================================== - -AC_ARG_WITH(gonk, -[ --with-gonk=DIR location of gonk dir], - gonkdir=$withval) - -if test -n "$gonkdir" ; then - dnl Most things are directly configured by env vars when building for gonk - - AC_DEFINE(ANDROID) -else case "$target" in *-android*|*-linuxandroid*) if test -z "$android_ndk" ; then @@ -246,7 +231,6 @@ case "$target" in AC_DEFINE(ANDROID) ;; esac -fi dnl ======================================================== dnl = diff --git a/nsprpub/lib/ds/plvrsion.c b/nsprpub/lib/ds/plvrsion.c index 8b351b4db6..8bbf67653d 100644 --- a/nsprpub/lib/ds/plvrsion.c +++ b/nsprpub/lib/ds/plvrsion.c @@ -54,7 +54,7 @@ PRVersionDescription VERSION_DESC_NAME = /* filename */ _PRODUCTION, /* the produced library name */ /* description */ "Portable runtime", /* what we are */ /* security */ "N/A", /* not applicable here */ - /* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved", + /* copywrite */ "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.", /* comment */ "http://www.mozilla.org/MPL/", /* specialString */ "" }; diff --git a/nsprpub/lib/libc/src/plvrsion.c b/nsprpub/lib/libc/src/plvrsion.c index c4bc7a8317..f2b6278bfd 100644 --- a/nsprpub/lib/libc/src/plvrsion.c +++ b/nsprpub/lib/libc/src/plvrsion.c @@ -54,7 +54,7 @@ PRVersionDescription VERSION_DESC_NAME = /* filename */ _PRODUCTION, /* the produced library name */ /* description */ "Portable runtime", /* what we are */ /* security */ "N/A", /* not applicable here */ - /* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved", + /* copywrite */ "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.", /* comment */ "http://www.mozilla.org/MPL/", /* specialString */ "" }; diff --git a/nsprpub/lib/prstreams/plvrsion.c b/nsprpub/lib/prstreams/plvrsion.c index 27fd058d70..4832e70801 100644 --- a/nsprpub/lib/prstreams/plvrsion.c +++ b/nsprpub/lib/prstreams/plvrsion.c @@ -54,7 +54,7 @@ PRVersionDescription VERSION_DESC_NAME = /* filename */ _PRODUCTION, /* the produced library name */ /* description */ "Portable runtime", /* what we are */ /* security */ "N/A", /* not applicable here */ - /* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved", + /* copywrite */ "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.", /* comment */ "http://www.mozilla.org/MPL/", /* specialString */ "" }; diff --git a/nsprpub/patches/nspr-ws2_32.patch b/nsprpub/patches/nspr-ws2_32.patch new file mode 100644 index 0000000000..fffac5d7b8 --- /dev/null +++ b/nsprpub/patches/nspr-ws2_32.patch @@ -0,0 +1,27 @@ +diff --git a/nsprpub/pr/src/md/windows/w95sock.c b/nsprpub/pr/src/md/windows/w95sock.c +index 0429c65..c3c4634 100644 +--- a/nsprpub/pr/src/md/windows/w95sock.c ++++ b/nsprpub/pr/src/md/windows/w95sock.c +@@ -4,16 +4,22 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + /* Win95 Sockets module + * + */ + + #include "primpl.h" + ++#if defined(_WIN64) ++#if defined(_MSC_VER) ++#pragma comment(lib, "ws2_32.lib") ++#endif ++#endif ++ + #define READ_FD 1 + #define WRITE_FD 2 + #define CONNECT_FD 3 + + static PRInt32 socket_io_wait( + PROsfd osfd, + PRInt32 fd_type, + PRIntervalTime timeout); diff --git a/nsprpub/pr/include/md/_win32_errors.h b/nsprpub/pr/include/md/_win32_errors.h index 1c9623723f..173f6b3937 100644 --- a/nsprpub/pr/include/md/_win32_errors.h +++ b/nsprpub/pr/include/md/_win32_errors.h @@ -83,7 +83,7 @@ extern void _MD_win32_map_accept_error(PRInt32 err); extern void _MD_win32_map_acceptex_error(PRInt32 err); #define _PR_MD_MAP_ACCEPTEX_ERROR _MD_win32_map_acceptex_error -extern PRInt32 _MD_win32_map_connect_error(PRInt32 err); +extern void _MD_win32_map_connect_error(PRInt32 err); #define _PR_MD_MAP_CONNECT_ERROR _MD_win32_map_connect_error extern void _MD_win32_map_bind_error(PRInt32 err); diff --git a/nsprpub/pr/include/prbit.h b/nsprpub/pr/include/prbit.h index 0434fc6838..2ace89972f 100644 --- a/nsprpub/pr/include/prbit.h +++ b/nsprpub/pr/include/prbit.h @@ -14,7 +14,8 @@ PR_BEGIN_EXTERN_C ** functions. */ #if defined(_WIN32) && (_MSC_VER >= 1300) && \ - (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)) + (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \ + defined(_M_ARM64)) # include # pragma intrinsic(_BitScanForward,_BitScanReverse) __forceinline static int __prBitScanForward32(unsigned int val) @@ -33,7 +34,8 @@ PR_BEGIN_EXTERN_C # define pr_bitscan_clz32(val) __prBitScanReverse32(val) # define PR_HAVE_BUILTIN_BITSCAN32 #elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \ - (defined(__i386__) || defined(__x86_64__) || defined(__arm__)) + (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ + defined(__aarch64__)) # define pr_bitscan_ctz32(val) __builtin_ctz(val) # define pr_bitscan_clz32(val) __builtin_clz(val) # define PR_HAVE_BUILTIN_BITSCAN32 @@ -136,7 +138,7 @@ NSPR_API(PRIntn) PR_FloorLog2(PRUint32 i); */ #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \ - defined(_M_X64) || defined(_M_ARM)) + defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)) #include #pragma intrinsic(_rotl, _rotr) #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits) diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index 5f6b4e3de9..1957d963f1 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.20" +#define PR_VERSION "4.21 Beta" #define PR_VMAJOR 4 -#define PR_VMINOR 20 +#define PR_VMINOR 21 #define PR_VPATCH 0 -#define PR_BETA PR_FALSE +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/src/io/pripv6.c b/nsprpub/pr/src/io/pripv6.c index af7de49dea..cdd1ce5491 100644 --- a/nsprpub/pr/src/io/pripv6.c +++ b/nsprpub/pr/src/io/pripv6.c @@ -247,7 +247,7 @@ static PRInt32 PR_CALLBACK Ipv6ToIpv4SocketRecvFrom(PRFileDesc *fd, void *buf, #if defined(_PR_INET6_PROBE) static PRBool ipv6_is_present; -extern PRBool _pr_test_ipv6_socket(void); +PR_EXTERN(PRBool) _pr_test_ipv6_socket(void); #if !defined(_PR_INET6) && defined(_PR_HAVE_GETIPNODEBYNAME) extern PRStatus _pr_find_getipnodebyname(void); diff --git a/nsprpub/pr/src/md/windows/w95sock.c b/nsprpub/pr/src/md/windows/w95sock.c index c6a3ec111f..31c26a29d8 100644 --- a/nsprpub/pr/src/md/windows/w95sock.c +++ b/nsprpub/pr/src/md/windows/w95sock.c @@ -9,6 +9,12 @@ #include "primpl.h" +#if defined(_WIN64) +#if defined(_MSC_VER) +#pragma comment(lib, "ws2_32.lib") +#endif +#endif + #define READ_FD 1 #define WRITE_FD 2 #define CONNECT_FD 3 diff --git a/nsprpub/pr/src/prvrsion.c b/nsprpub/pr/src/prvrsion.c index be43578ca7..c27b493a7e 100644 --- a/nsprpub/pr/src/prvrsion.c +++ b/nsprpub/pr/src/prvrsion.c @@ -54,7 +54,7 @@ PRVersionDescription VERSION_DESC_NAME = /* filename */ _PRODUCTION, /* the produced library name */ /* description */ "Portable runtime", /* what we are */ /* security */ "N/A", /* not applicable here */ - /* copywrite */ "Copyright (c) 1998 Netscape Communications Corporation. All Rights Reserved", + /* copywrite */ "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.", /* comment */ "License information: http://www.mozilla.org/MPL/", /* specialString */ "" }; diff --git a/nsprpub/pr/tests/abstract.c b/nsprpub/pr/tests/abstract.c index 6be5610c04..47c4637a7a 100644 --- a/nsprpub/pr/tests/abstract.c +++ b/nsprpub/pr/tests/abstract.c @@ -151,7 +151,7 @@ main() int main() { - prinf("PASS\n"); + printf("PASS\n"); return 0; } #endif diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 5e6588f9d8..c0adbeacad 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -40,7 +40,7 @@ static char *compatible_version[] = { "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9", "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15", - "4.16", "4.17", "4.18", "4.19", + "4.16", "4.17", "4.18", "4.19", "4.20", PR_VERSION }; @@ -56,8 +56,8 @@ 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.20.1", - "4.21", "4.21.1", + "4.21.1", + "4.22", "4.22.1", "10.0", "11.1", "12.14.20" };