From 7c728b3c7680662fc4e92b5d03697b8339560b08 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 6 Feb 2018 11:40:35 +0100 Subject: Update NSPR to 4.16 --- nsprpub/pr/include/md/_linux.cfg | 3 +++ nsprpub/pr/include/md/_win95.h | 3 +++ nsprpub/pr/include/prinit.h | 6 +++--- nsprpub/pr/include/private/primpl.h | 19 +++++++++++++++++++ nsprpub/pr/include/prtypes.h | 16 ++++++++++++---- 5 files changed, 40 insertions(+), 7 deletions(-) (limited to 'nsprpub/pr/include') diff --git a/nsprpub/pr/include/md/_linux.cfg b/nsprpub/pr/include/md/_linux.cfg index 8cbf0cb9b..b4c0ed427 100644 --- a/nsprpub/pr/include/md/_linux.cfg +++ b/nsprpub/pr/include/md/_linux.cfg @@ -498,6 +498,9 @@ #elif defined(__mips__) +/* For _ABI64 */ +#include + #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 #undef IS_LITTLE_ENDIAN diff --git a/nsprpub/pr/include/md/_win95.h b/nsprpub/pr/include/md/_win95.h index d65e26437..04f811d37 100644 --- a/nsprpub/pr/include/md/_win95.h +++ b/nsprpub/pr/include/md/_win95.h @@ -290,6 +290,9 @@ extern void _MD_MakeNonblock(PRFileDesc *f); extern PRInt32 _MD_CloseSocket(PROsfd osfd); #define _MD_CLOSE_SOCKET _MD_CloseSocket #define _MD_SENDTO _PR_MD_SENDTO +#ifdef _WIN64 +#define _MD_TCPSENDTO _PR_MD_TCPSENDTO +#endif #define _MD_RECVFROM _PR_MD_RECVFROM #define _MD_SOCKETPAIR(s, type, proto, sv) -1 #define _MD_GETSOCKNAME _PR_MD_GETSOCKNAME diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index e27fc34d0..fd935ec30 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,10 +31,10 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.13.1" +#define PR_VERSION "4.16" #define PR_VMAJOR 4 -#define PR_VMINOR 13 -#define PR_VPATCH 1 +#define PR_VMINOR 16 +#define PR_VPATCH 0 #define PR_BETA PR_FALSE /* diff --git a/nsprpub/pr/include/private/primpl.h b/nsprpub/pr/include/private/primpl.h index 63ba3ee46..dc24a2572 100644 --- a/nsprpub/pr/include/private/primpl.h +++ b/nsprpub/pr/include/private/primpl.h @@ -1225,6 +1225,13 @@ extern PRInt32 _PR_MD_SENDTO( const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout); #define _PR_MD_SENDTO _MD_SENDTO +#if defined(_WIN64) && defined(WIN95) +extern PRInt32 _PR_MD_TCPSENDTO( + PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, + const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout); +#define _PR_MD_TCPSENDTO _MD_TCPSENDTO +#endif + extern PRInt32 _PR_MD_SOCKETPAIR(int af, int type, int flags, PROsfd *osfd); #define _PR_MD_SOCKETPAIR _MD_SOCKETPAIR @@ -1747,6 +1754,18 @@ struct PRFilePrivate { * requires knowing the address family of the * socket, we save the address family here. */ #endif + +#if defined(_WIN64) + /* This is necessary for TCP Fast Open. TCP Fast Open in windows must + * use ConnectEx function which uses OVERLAPPED. TCPSendTo will call + * ConnectEx to send fast open data. If ConnectEx returns + * ERROR_IO_PENDING we need to save OVERLAPPED structure and we will + * use it in ConnectContinue to get the final result of ConnectEx. + */ + PRBool alreadyConnected; + PRBool overlappedActive; + OVERLAPPED ol; +#endif }; #ifdef _WIN64 diff --git a/nsprpub/pr/include/prtypes.h b/nsprpub/pr/include/prtypes.h index 52b3ab0b1..94bca3cfc 100644 --- a/nsprpub/pr/include/prtypes.h +++ b/nsprpub/pr/include/prtypes.h @@ -231,7 +231,7 @@ PR_BEGIN_EXTERN_C ** to use . A patch to do that is in NSPR bug 634793. */ -#if defined(__APPLE__) || defined(__ANDROID__) || defined(__OpenBSD__) +#if defined(__APPLE__) || defined(__OpenBSD__) #define PR_ALTERNATE_INT64_TYPEDEF #endif @@ -245,16 +245,24 @@ PR_BEGIN_EXTERN_C #if PR_BYTES_PER_BYTE == 1 typedef unsigned char PRUint8; /* +** There are two scenarios that require us to define PRInt8 as type 'char'. +** (1) ** Some cfront-based C++ compilers do not like 'signed char' and ** issue the warning message: ** warning: "signed" not implemented (ignored) ** For these compilers, we have to define PRInt8 as plain 'char'. ** Make sure that plain 'char' is indeed signed under these compilers. +** (2) +** Mozilla C++ code expects the PRInt{N} and int{N}_t types to match (see bug +** 634793). If a platform defines int8_t as 'char', but NSPR defines it as +** 'signed char', it results in a type mismatch. +** On such platforms we define PRInt8 as 'char' to avoid the mismatch. */ -#if (defined(HPUX) && defined(__cplusplus) \ +#if (defined(HPUX) && defined(__cplusplus) /* reason 1*/ \ && !defined(__GNUC__) && __cplusplus < 199707L) \ - || (defined(SCO) && defined(__cplusplus) \ - && !defined(__GNUC__) && __cplusplus == 1L) + || (defined(SCO) && defined(__cplusplus) /* reason 1 */ \ + && !defined(__GNUC__) && __cplusplus == 1L) \ + || (defined(__sun) && defined(__cplusplus)) /* reason 2 */ typedef char PRInt8; #else typedef signed char PRInt8; -- cgit v1.2.3