Merged NSPR 4.0 release onto the main trunk.

This commit is contained in:
wtc%netscape.com 2000-03-03 19:53:57 +00:00
Родитель 657ce47810
Коммит a442830fd9
18 изменённых файлов: 65 добавлений и 63 удалений

Просмотреть файл

@ -47,8 +47,6 @@ IMPL_STRATEGY = _PTH
DEFINES += -D_REENTRANT
endif
USE_IPV6 = 1
ifeq (86,$(findstring 86,$(OS_TEST)))
CPU_ARCH := x86
else

Просмотреть файл

@ -73,9 +73,6 @@
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#ifndef _PR_INET6
#define _PR_INET6
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -74,9 +74,6 @@
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#ifndef _PR_INET6
#define _PR_INET6
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#ifndef NO_NSPR_10_SUPPORT

Просмотреть файл

@ -27,6 +27,8 @@
#define BEOS
#endif
#define PR_AF_INET6 5 /* same as AF_INET6 */
#ifdef __powerpc__
#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1

Просмотреть файл

@ -27,6 +27,8 @@
#define BSDI
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#if defined(__i386__)
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -27,6 +27,8 @@
#define RHAPOSDY
#endif
#define PR_AF_INET6 30 /* same as AF_INET6 */
#if defined(i386)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -33,6 +33,8 @@
#undef HAVE_ALIGNED_DOUBLES
#undef HAVE_ALIGNED_LONGLONGS
#define PR_AF_INET6 28 /* same as AF_INET6 */
#if defined(__i386__)
#define PR_BYTES_PER_BYTE 1

Просмотреть файл

@ -70,7 +70,8 @@
#else
#define _PR_NO_LARGE_FILES
#endif
#ifdef _PR_INET6
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
#define _PR_INET6
#define _PR_HAVE_GETHOSTBYNAME2
#define _PR_INET6_PROBE
#endif
@ -97,11 +98,11 @@ extern void _MD_CleanupBeforeExit(void);
* On the PowerPC, the new style jmp_buf isn't used until glibc
* 2.1.
*/
#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[JB_GPR1]
#else
#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__misc[0]
#endif /* __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 */
#endif /* glibc 2.1 or later */
#define _MD_SET_FP(_t, val)
#define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
#define _MD_GET_FP_PTR(_t) ((void *) 0)

Просмотреть файл

@ -27,6 +27,8 @@
#define NETBSD
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#if defined(__i386__) || defined(__arm32__)
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -27,6 +27,8 @@
#define NTO
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#ifdef __i386__
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -27,6 +27,8 @@
#define OPENBSD
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#if defined(__i386__) || defined(__arm32__)
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -36,6 +36,8 @@
#undef IS_64
#endif
#define PR_AF_INET6 26 /* same as AF_INET6 */
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4

Просмотреть файл

@ -39,6 +39,8 @@
#define HAVE_LONG_LONG 1
#endif
#define PR_AF_INET6 24 /* same as AF_INET6 */
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4

Просмотреть файл

@ -27,6 +27,8 @@
#define RHAPOSDY
#endif
#define PR_AF_INET6 30 /* same as AF_INET6 */
#if defined(i386)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1

Просмотреть файл

@ -178,34 +178,6 @@ union PRNetAddr {
#endif
};
/*
** The PR_NETADDR_SIZE macro can only be called on a PRNetAddr union
** whose 'family' field is set. It returns the size of the union
** member corresponding to the specified address family.
*/
#if defined(_PR_INET6)
#define PR_NETADDR_SIZE(_addr) PR_NetAddrSize(_addr)
#else
#if defined(XP_UNIX)
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \
: ((_addr)->raw.family == PR_AF_INET6 \
? sizeof((_addr)->ipv6) \
: sizeof((_addr)->local)))
#else
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \
: sizeof((_addr)->ipv6))
#endif /* defined(XP_UNIX) */
#endif /* defined(_PR_INET6) */
/*
***************************************************************************
** PRSockOption
@ -1108,8 +1080,6 @@ NSPR_API(PRStatus) PR_MakeDir(const char *name, PRIntn mode);
NSPR_API(PRStatus) PR_RmDir(const char *name);
NSPR_API(PRUintn) PR_NetAddrSize(const PRNetAddr* addr);
/*
*************************************************************************
* FUNCTION: PR_NewUDPSocket

Просмотреть файл

@ -1268,6 +1268,36 @@ extern PRFileDesc *_PR_InvalidDesc(void);
extern PRIOMethods _pr_faulty_methods;
/*
** The PR_NETADDR_SIZE macro can only be called on a PRNetAddr union
** whose 'family' field is set. It returns the size of the union
** member corresponding to the specified address family.
*/
extern PRUintn _PR_NetAddrSize(const PRNetAddr* addr);
#if defined(_PR_INET6)
#define PR_NETADDR_SIZE(_addr) _PR_NetAddrSize(_addr)
#else
#if defined(XP_UNIX)
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \
: ((_addr)->raw.family == PR_AF_INET6 \
? sizeof((_addr)->ipv6) \
: sizeof((_addr)->local)))
#else
#define PR_NETADDR_SIZE(_addr) \
((_addr)->raw.family == PR_AF_INET \
? sizeof((_addr)->inet) \
: sizeof((_addr)->ipv6))
#endif /* defined(XP_UNIX) */
#endif /* defined(_PR_INET6) */
extern PRStatus _PR_MapOptionName(
PRSockOption optname, PRInt32 *level, PRInt32 *name);
extern void _PR_InitThreads(

Просмотреть файл

@ -863,7 +863,7 @@ PR_IMPLEMENT(PRStatus) PR_GetProtoByNumber(
}
PR_IMPLEMENT(PRUintn) PR_NetAddrSize(const PRNetAddr* addr)
PRUintn _PR_NetAddrSize(const PRNetAddr* addr)
{
PRUintn addrsize;
@ -890,7 +890,7 @@ PR_IMPLEMENT(PRUintn) PR_NetAddrSize(const PRNetAddr* addr)
else addrsize = 0;
return addrsize;
} /* PR_NetAddrSize */
} /* _PR_NetAddrSize */
PR_IMPLEMENT(PRIntn) PR_EnumerateHostEnt(
PRIntn enumIndex, const PRHostEnt *hostEnt, PRUint16 port, PRNetAddr *address)

Просмотреть файл

@ -16,15 +16,6 @@
* Reserved.
*/
#ifdef XP_BEOS
#include <stdio.h>
int main()
{
printf( "BeOS does not support IPv6\n" );
return 0;
}
#else
#include "prio.h"
#include "prenv.h"
#include "prmem.h"
@ -45,6 +36,10 @@ int main()
#define HOST_BUFFER 1024
#define PROTO_BUFFER 1500
#define NETADDR_SIZE(addr) \
(PR_AF_INET == (addr)->raw.family ? \
sizeof((addr)->inet) : sizeof((addr)->ipv6))
static PRFileDesc *err = NULL;
static void Help(void)
@ -59,7 +54,7 @@ static void DumpAddr(const PRNetAddr* address, const char *msg)
{
PRUint32 *word = (PRUint32*)address;
PRUint32 addr_len = sizeof(PRNetAddr);
PR_fprintf(err, "%s[%d]\t", msg, PR_NETADDR_SIZE(address));
PR_fprintf(err, "%s[%d]\t", msg, NETADDR_SIZE(address));
while (addr_len > 0)
{
PR_fprintf(err, " %08x", *word++);
@ -73,7 +68,6 @@ static PRStatus PrintAddress(const PRNetAddr* address)
PRNetAddr translation;
char buffer[ADDR_BUFFER];
PRStatus rv = PR_NetAddrToString(address, buffer, sizeof(buffer));
memset(&translation, 0, sizeof(PRNetAddr));
if (PR_FAILURE == rv) PL_FPrintError(err, "PR_NetAddrToString");
else
{
@ -83,7 +77,7 @@ static PRStatus PrintAddress(const PRNetAddr* address)
if (PR_FAILURE == rv) PL_FPrintError(err, "PR_StringToNetAddr");
else
{
PRSize addr_len = PR_NETADDR_SIZE(address);
PRSize addr_len = NETADDR_SIZE(address);
if (0 != memcmp(address, &translation, addr_len))
{
PR_fprintf(err, "Address translations do not match\n");
@ -102,7 +96,6 @@ PRIntn main(PRIntn argc, char **argv)
PLOptStatus os;
PRHostEnt host;
PRProtoEnt proto;
PRBool ipv6 = PR_FALSE;
const char *name = NULL;
PRBool failed = PR_FALSE, version = PR_FALSE;
PLOptState *opt = PL_CreateOptState(argc, argv, "Vh");
@ -130,12 +123,10 @@ PRIntn main(PRIntn argc, char **argv)
if (version)
{
#if defined(XP_UNIX) || defined(XP_OS2)
#define NSPR_LIB "nspr21"
#elif defined(WIN32)
#define NSPR_LIB "libnspr21"
#if defined(WINNT)
#define NSPR_LIB "libnspr4"
#else
#error "Architecture not supported"
#define NSPR_LIB "nspr4"
#endif
const PRVersionDescription *version_info;
char *nspr_path = PR_GetEnv("LD_LIBRARY_PATH");
@ -236,5 +227,3 @@ PRIntn main(PRIntn argc, char **argv)
return (failed) ? 1 : 0;
}
#endif /* XP_BEOS */