diff options
Diffstat (limited to 'pr/include')
45 files changed, 336 insertions, 560 deletions
diff --git a/pr/include/.cvsignore b/pr/include/.cvsignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/pr/include/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/pr/include/Makefile b/pr/include/Makefile deleted file mode 100644 index 92fd718a..00000000 --- a/pr/include/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.1 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -#! gmake - -MOD_DEPTH = ../.. - -DIRS = md private obsolete - -include $(MOD_DEPTH)/config/config.mk - -HEADERS = $(wildcard *.h) - -RELEASE_HEADERS = $(HEADERS) -RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR) - -include $(MOD_DEPTH)/config/rules.mk - -export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL) -endif diff --git a/pr/include/Makefile.in b/pr/include/Makefile.in index d3f4a846..7ef8196f 100644 --- a/pr/include/Makefile.in +++ b/pr/include/Makefile.in @@ -36,7 +36,4 @@ RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR) include $(topsrcdir)/config/rules.mk export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL) -endif + $(INSTALL) -m 444 $(RELEASE_HEADERS) $(dist_includedir) diff --git a/pr/include/md/.cvsignore b/pr/include/md/.cvsignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/pr/include/md/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/pr/include/md/Makefile b/pr/include/md/Makefile deleted file mode 100644 index 08b0efc7..00000000 --- a/pr/include/md/Makefile +++ /dev/null @@ -1,189 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.1 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -#! gmake - -MOD_DEPTH = ../../.. - -HEADERS = $(wildcard *.h) - -include $(MOD_DEPTH)/config/rules.mk - -ifeq ($(OS_ARCH),IRIX) -ifeq ($(USE_64), 1) -MDCPUCFG_H = _irix64.cfg -else -MDCPUCFG_H = _irix32.cfg -endif -endif - -ifeq ($(OS_ARCH),WINNT) -ifeq ($(OS_TARGET), WIN95) -MDCPUCFG_H = _win95.cfg -else -ifeq ($(OS_TARGET), WIN16) -MDCPUCFG_H = _win16.cfg -else -MDCPUCFG_H = _winnt.cfg -endif -endif -endif - -ifeq ($(OS_ARCH),OS2) -MDCPUCFG_H = _os2.cfg -endif - -ifeq ($(OS_ARCH),AIX) -ifeq ($(USE_64),1) -MDCPUCFG_H = _aix64.cfg -else -ifeq ($(USE_IPV6),1) -MDCPUCFG_H = _aix32in6.cfg -else -MDCPUCFG_H = _aix32.cfg -endif -endif -endif - -ifeq ($(OS_ARCH),BSD_OS) -MDCPUCFG_H = _bsdi.cfg -endif - -ifeq ($(OS_ARCH),FreeBSD) -MDCPUCFG_H = _freebsd.cfg -endif - -ifeq ($(OS_ARCH),OpenBSD) -MDCPUCFG_H = _openbsd.cfg -endif - -ifeq ($(OS_ARCH),OpenVMS) -MDCPUCFG_H = _openvms.cfg -endif - -ifeq ($(OS_ARCH),NetBSD) -MDCPUCFG_H = _netbsd.cfg -endif - -ifeq ($(OS_ARCH),HP-UX) -ifeq ($(USE_64), 1) -MDCPUCFG_H = _hpux64.cfg -else -MDCPUCFG_H = _hpux32.cfg -endif -endif - -ifeq ($(OS_ARCH),Linux) -MDCPUCFG_H = _linux.cfg -endif - -ifeq ($(OS_ARCH),OSF1) -MDCPUCFG_H = _osf1.cfg -endif - -ifeq ($(OS_ARCH),SunOS) -ifeq ($(OS_RELEASE),4.1.3_U1) -MDCPUCFG_H = _sunos4.cfg -else -ifeq ($(USE_64),1) -MDCPUCFG_H = _solaris64.cfg -else -MDCPUCFG_H = _solaris32.cfg -endif -endif -endif - -ifeq ($(OS_ARCH),SINIX) -MDCPUCFG_H = _reliantunix.cfg -endif - -ifeq ($(OS_ARCH),Rhapsody) -MDCPUCFG_H = _rhapsody.cfg -endif - -ifeq ($(OS_ARCH),NEXTSTEP) -MDCPUCFG_H = _nextstep.cfg -endif - -ifeq ($(OS_ARCH),NEWS-OS) -MDCPUCFG_H = _sony.cfg -endif - -ifeq ($(OS_ARCH),NEC) -MDCPUCFG_H = _nec.cfg -endif - -ifeq ($(OS_ARCH),SCOOS) -MDCPUCFG_H = _scoos.cfg -endif - -ifeq ($(OS_ARCH),UNIXWARE) -ifeq (,$(filter-out 2.1,$(OS_RELEASE))) -MDCPUCFG_H = _unixware.cfg -else -MDCPUCFG_H = _unixware7.cfg -endif -endif - -ifeq ($(OS_ARCH),NCR) -MDCPUCFG_H = _ncr.cfg -endif - -ifeq ($(OS_ARCH),DGUX) -MDCPUCFG_H = _dgux.cfg -endif - -ifeq ($(OS_ARCH),QNX) -MDCPUCFG_H = _qnx.cfg -endif - -ifeq ($(OS_TARGET),NTO) -MDCPUCFG_H = _nto.cfg -endif - -ifeq ($(OS_ARCH),BeOS) -MDCPUCFG_H = _beos.cfg -endif - -export:: $(MDCPUCFG_H) - $(INSTALL) -m 444 $(MDCPUCFG_H) $(DIST)/include -ifeq ($(MOZ_BITS),16) - cp $(DIST)/include/$(MDCPUCFG_H) $(DIST)/include/prcpucfg.h - $(INSTALL) -m 444 $(MDCPUCFG_H) $(MOZ_INCL) - mv -f $(DIST)/include/$(MDCPUCFG_H) $(MOZ_INCL)/prcpucfg.h -else -ifneq ($(OS_ARCH),OpenVMS) - mv -f $(DIST)/include/$(MDCPUCFG_H) $(DIST)/include/prcpucfg.h -else -# mv'ing a link causes the file itself to move, not the link. - rm -f $(DIST)/include/$(MDCPUCFG_H) - rm -f $(DIST)/include/prcpucfg.h - ln -fs `pwd`/$(MDCPUCFG_H) $(DIST)/include/prcpucfg.h -endif -endif - -release:: export - @echo "Copying machine-dependent prcpucfg.h" - @if test -z "$(BUILD_NUMBER)"; then \ - echo "BUILD_NUMBER must be defined"; \ - false; \ - fi - @if test ! -d $(RELEASE_INCLUDE_DIR); then \ - rm -rf $(RELEASE_INCLUDE_DIR); \ - $(NSINSTALL) -D $(RELEASE_INCLUDE_DIR);\ - fi - cp $(MDCPUCFG_H) $(RELEASE_INCLUDE_DIR)/prcpucfg.h diff --git a/pr/include/md/Makefile.in b/pr/include/md/Makefile.in index 0ab32b1d..2f3962c7 100644 --- a/pr/include/md/Makefile.in +++ b/pr/include/md/Makefile.in @@ -29,158 +29,23 @@ CONFIGS = $(wildcard $(srcdir)/*.cfg) include $(topsrcdir)/config/rules.mk -ifndef USE_AUTOCONF - -ifeq ($(OS_ARCH),IRIX) -ifeq ($(USE_64), 1) -MDCPUCFG_H = _irix64.cfg -else -MDCPUCFG_H = _irix32.cfg -endif -endif - -ifeq ($(OS_ARCH),WINNT) -ifeq ($(OS_TARGET), WIN95) -MDCPUCFG_H = _win95.cfg -else -ifeq ($(OS_TARGET), WIN16) -MDCPUCFG_H = _win16.cfg -else -ifeq ($(OS_TARGET),OS2) -MDCPUCFG_H = _os2.cfg -else -MDCPUCFG_H = _winnt.cfg -endif -endif -endif -endif - -ifeq ($(OS_ARCH),AIX) -ifeq ($(USE_64),1) -MDCPUCFG_H = _aix64.cfg -else -ifeq ($(USE_IPV6),1) -MDCPUCFG_H = _aix32in6.cfg -else -MDCPUCFG_H = _aix32.cfg -endif -endif -endif - -ifeq ($(OS_ARCH),BSD_OS) -MDCPUCFG_H = _bsdi.cfg -endif - -ifeq ($(OS_ARCH),FreeBSD) -MDCPUCFG_H = _freebsd.cfg -endif - -ifeq ($(OS_ARCH),OpenBSD) -MDCPUCFG_H = _openbsd.cfg -endif - -ifeq ($(OS_ARCH),OpenVMS) -MDCPUCFG_H = _openvms.cfg -endif - -ifeq ($(OS_ARCH),NetBSD) -MDCPUCFG_H = _netbsd.cfg -endif - -ifeq ($(OS_ARCH),HP-UX) -ifeq ($(USE_64), 1) -MDCPUCFG_H = _hpux64.cfg -else -MDCPUCFG_H = _hpux32.cfg -endif -endif - -ifeq ($(OS_ARCH),Linux) -MDCPUCFG_H = _linux.cfg -endif - -ifeq ($(OS_ARCH),OSF1) -MDCPUCFG_H = _osf1.cfg -endif - -ifeq ($(OS_ARCH),SunOS) -ifeq ($(OS_RELEASE),4.1.3_U1) -MDCPUCFG_H = _sunos4.cfg -else -ifeq ($(USE_64),1) -MDCPUCFG_H = _solaris64.cfg -else -MDCPUCFG_H = _solaris32.cfg -endif -endif -endif - -ifeq ($(OS_ARCH),SINIX) -MDCPUCFG_H = _reliantunix.cfg -endif - -ifeq ($(OS_ARCH),Rhapsody) -MDCPUCFG_H = _rhapsody.cfg -endif - -ifeq ($(OS_ARCH),NEXTSTEP) -MDCPUCFG_H = _nextstep.cfg -endif - -ifeq ($(OS_ARCH),NEWS-OS) -MDCPUCFG_H = _sony.cfg -endif - -ifeq ($(OS_ARCH),NEC) -MDCPUCFG_H = _nec.cfg -endif - -ifeq ($(OS_ARCH),SCOOS) -MDCPUCFG_H = _scoos.cfg -endif - -ifeq ($(OS_ARCH),UNIXWARE) -ifeq (,$(filter-out 2.1,$(OS_RELEASE))) -MDCPUCFG_H = _unixware.cfg -else -MDCPUCFG_H = _unixware7.cfg -endif -endif - -ifeq ($(OS_ARCH),NCR) -MDCPUCFG_H = _ncr.cfg -endif - -ifeq ($(OS_ARCH),DGUX) -MDCPUCFG_H = _dgux.cfg -endif - -ifeq ($(OS_ARCH),QNX) -MDCPUCFG_H = _qnx.cfg -endif - -ifeq ($(OS_TARGET),NTO) -MDCPUCFG_H = _nto.cfg -endif - -ifeq ($(OS_ARCH),BeOS) -MDCPUCFG_H = _beos.cfg -endif - -endif # ! USE_AUTOCONF - export:: $(MDCPUCFG_H) - $(INSTALL) -m 444 $(CONFIGS) $(DIST)/include/md - $(INSTALL) -m 444 $(srcdir)/$(MDCPUCFG_H) $(DIST)/include + $(INSTALL) -m 444 $(CONFIGS) $(dist_includedir)/md + $(INSTALL) -m 444 $(srcdir)/$(MDCPUCFG_H) $(dist_includedir) ifneq ($(OS_ARCH),OpenVMS) - mv -f $(DIST)/include/$(MDCPUCFG_H) $(DIST)/include/prcpucfg.h + mv -f $(dist_includedir)/$(MDCPUCFG_H) $(dist_includedir)/prcpucfg.h else # mv'ing a link causes the file itself to move, not the link. - rm -f $(DIST)/include/$(MDCPUCFG_H) - rm -f $(DIST)/include/prcpucfg.h - ln -fs `pwd`/$(MDCPUCFG_H) $(DIST)/include/prcpucfg.h + rm -f $(dist_includedir)/$(MDCPUCFG_H) + rm -f $(dist_includedir)/prcpucfg.h + ln -fs $(srcdir)/$(MDCPUCFG_H) $(dist_includedir)/prcpucfg.h endif +real_install:: + $(NSINSTALL) -D $(DESTDIR)$(includedir)/md + cp $(srcdir)/$(MDCPUCFG_H) $(DESTDIR)$(includedir)/prcpucfg.h + $(NSINSTALL) -t -m 644 $(CONFIGS) $(HEADERS) $(DESTDIR)$(includedir)/md + release:: export @echo "Copying machine-dependent prcpucfg.h" @if test -z "$(BUILD_NUMBER)"; then \ diff --git a/pr/include/md/_aix32in6.cfg b/pr/include/md/_aix32in6.cfg index 0385e86a..fcaec9d9 100644 --- a/pr/include/md/_aix32in6.cfg +++ b/pr/include/md/_aix32in6.cfg @@ -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 diff --git a/pr/include/md/_aix64.cfg b/pr/include/md/_aix64.cfg index 59bb1a79..8606ff74 100644 --- a/pr/include/md/_aix64.cfg +++ b/pr/include/md/_aix64.cfg @@ -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 diff --git a/pr/include/md/_beos.cfg b/pr/include/md/_beos.cfg index a1e3d89d..cbdaecdd 100644 --- a/pr/include/md/_beos.cfg +++ b/pr/include/md/_beos.cfg @@ -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 diff --git a/pr/include/md/_beos.h b/pr/include/md/_beos.h index 8b56dec3..2cb25407 100644 --- a/pr/include/md/_beos.h +++ b/pr/include/md/_beos.h @@ -72,8 +72,9 @@ /* Define threading functions and objects as native BeOS */ struct _MDThread { thread_id tid; /* BeOS thread handle */ - bool is_joinable; /* TRUE if PR_JOINABLE */ - bool is_joining; /* TRUE if we were woken up to join */ + sem_id joinSem; /* sems used to synchronzie joining */ + PRBool is_joining; /* TRUE if someone is currently waiting to + join this thread */ }; struct _MDThreadStack { diff --git a/pr/include/md/_bsdi.cfg b/pr/include/md/_bsdi.cfg index 8a9839a4..5b7fa33f 100644 --- a/pr/include/md/_bsdi.cfg +++ b/pr/include/md/_bsdi.cfg @@ -27,6 +27,8 @@ #define BSDI #endif +#define PR_AF_INET6 24 /* same as AF_INET6 */ + #if defined(__i386__) #define IS_LITTLE_ENDIAN 1 diff --git a/pr/include/md/_darwin.cfg b/pr/include/md/_darwin.cfg index 87a76c95..33da779e 100644 --- a/pr/include/md/_darwin.cfg +++ b/pr/include/md/_darwin.cfg @@ -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 diff --git a/pr/include/md/_darwin.h b/pr/include/md/_darwin.h index d97e6a3c..98a2f1ed 100644 --- a/pr/include/md/_darwin.h +++ b/pr/include/md/_darwin.h @@ -42,8 +42,8 @@ #define USE_MACH_DYLD #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC -#define _PR_TIMESPEC_HAS_TS_SEC #define _PR_NO_LARGE_FILES +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #define USE_SETJMP diff --git a/pr/include/md/_freebsd.cfg b/pr/include/md/_freebsd.cfg index b61641cf..167cf8b6 100644 --- a/pr/include/md/_freebsd.cfg +++ b/pr/include/md/_freebsd.cfg @@ -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 diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg index 33fa2683..6ad20d1b 100644 --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -65,9 +65,9 @@ #define PR_ALIGN_OF_SHORT 2 #define PR_ALIGN_OF_INT 4 #define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 +#define PR_ALIGN_OF_INT64 8 #define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 +#define PR_ALIGN_OF_DOUBLE 8 #define PR_ALIGN_OF_POINTER 4 #define PR_ALIGN_OF_WORD 4 @@ -359,11 +359,12 @@ #endif #define HAVE_LONG_LONG -/* - * XXX These two macros need to be investigated for different architectures. - */ -#undef HAVE_ALIGNED_DOUBLES -#undef HAVE_ALIGNED_LONGLONGS +#if PR_ALIGN_OF_DOUBLE == 8 +#define HAVE_ALIGNED_DOUBLES +#endif +#if PR_ALIGN_OF_INT64 == 8 +#define HAVE_ALIGNED_LONGLONGS +#endif #ifndef NO_NSPR_10_SUPPORT diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h index 11885b41..96905cf2 100644 --- a/pr/include/md/_linux.h +++ b/pr/include/md/_linux.h @@ -59,6 +59,19 @@ #define HAVE_DLL #define USE_DLFCN +#if defined(__i386__) +#define _PR_HAVE_ATOMIC_OPS +#define _MD_INIT_ATOMIC() +extern PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val); +#define _MD_ATOMIC_INCREMENT _PR_x86_AtomicIncrement +extern PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val); +#define _MD_ATOMIC_DECREMENT _PR_x86_AtomicDecrement +extern PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val); +#define _MD_ATOMIC_ADD _PR_x86_AtomicAdd +extern PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval); +#define _MD_ATOMIC_SET _PR_x86_AtomicSet +#endif + #define USE_SETJMP #if defined(__GLIBC__) && __GLIBC__ >= 2 #define _PR_POLL_AVAILABLE @@ -70,7 +83,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 +111,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) diff --git a/pr/include/md/_macos.h b/pr/include/md/_macos.h index cf38977f..43318527 100644 --- a/pr/include/md/_macos.h +++ b/pr/include/md/_macos.h @@ -91,7 +91,7 @@ typedef struct _MDSocketCallerInfo { struct _MDFileDesc { PRInt32 osfd; - PRBool connectionOpen; + PRBool orderlyDisconnect; PRBool readReady; PRBool writeReady; PRBool exceptReady; @@ -103,6 +103,7 @@ struct _MDFileDesc { _MDSocketCallerInfo misc; _MDSocketCallerInfo read; _MDSocketCallerInfo write; + _MDSocketCallerInfo poll; }; /* @@ -382,6 +383,19 @@ extern char* _MD_ReadDir(struct _MDDir *md,PRIntn flags); ** Socket I/O Related definitions */ +#if UNIVERSAL_INTERFACES_VERSION >= 0x0330 +/* In Universal Interfaces 3.3 and later, these are enums. */ +#define IP_TTL IP_TTL +#define IP_TOS IP_TOS +#define IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP +#define IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP +#define IP_MULTICAST_IF IP_MULTICAST_IF +#define IP_MULTICAST_TTL IP_MULTICAST_TTL +#define IP_MULTICAST_LOOP IP_MULTICAST_LOOP +#define TCP_NODELAY TCP_NODELAY +#define TCP_MAXSEG TCP_MAXSEG +#endif + #define _MD_SOCKET _MD_socket #define _MD_BIND _MD_bind #define _MD_LISTEN _MD_listen diff --git a/pr/include/md/_netbsd.cfg b/pr/include/md/_netbsd.cfg index ef52198e..92a0b81c 100644 --- a/pr/include/md/_netbsd.cfg +++ b/pr/include/md/_netbsd.cfg @@ -27,7 +27,9 @@ #define NETBSD #endif -#if defined(__i386__) || defined(__arm32__) +#define PR_AF_INET6 24 /* same as AF_INET6 */ + +#if defined(__i386__) || defined(__arm32__) || defined(__MIPSEL__) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN @@ -73,9 +75,9 @@ #define PR_ALIGN_OF_DOUBLE 4 #define PR_ALIGN_OF_POINTER 4 -#elif defined(__sparc__) || defined(__mips__) +#elif defined(__sparc__) || defined(__MIPSEB__) -#undef IS_LITTLE_ENDIAN 1 +#undef IS_LITTLE_ENDIAN #define IS_BIG_ENDIAN 1 #define HAVE_LONG_LONG #define HAVE_ALIGNED_DOUBLES diff --git a/pr/include/md/_netbsd.h b/pr/include/md/_netbsd.h index 49aca74b..5145a664 100644 --- a/pr/include/md/_netbsd.h +++ b/pr/include/md/_netbsd.h @@ -20,6 +20,7 @@ #define nspr_netbsd_defs_h___ #include <sys/syscall.h> +#include <sys/param.h> /* for __NetBSD_Version__ */ #define PR_LINKER_ARCH "netbsd" #define _PR_SI_SYSNAME "NetBSD" @@ -39,7 +40,11 @@ #define _PR_SI_ARCHITECTURE "arm32" #endif +#if defined(__ELF__) +#define PR_DLL_SUFFIX ".so" +#else #define PR_DLL_SUFFIX ".so.1.0" +#endif #define _PR_VMBASE 0x30000000 #define _PR_STACK_VMBASE 0x50000000 @@ -52,9 +57,17 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_NO_LARGE_FILES #define _PR_STAT_HAS_ST_ATIMESPEC +#define _PR_POLL_AVAILABLE +#define _PR_USE_POLL #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY +#if __NetBSD_Version__ >= 105000000 +#define _PR_INET6 +#define _PR_HAVE_GETHOSTBYNAME2 +#define _PR_INET6_PROBE +#endif + #define USE_SETJMP #ifndef _PR_PTHREADS @@ -64,40 +77,89 @@ #define CONTEXT(_th) ((_th)->md.context) -#if defined(__i386__) || defined(__sparc__) || defined(__m68k__) || defined(__powerpc__) -#define JB_SP_INDEX 2 -#elif defined(__mips__) -#define JB_SP_INDEX 4 -#elif defined(__alpha__) -#define JB_SP_INDEX 34 -#elif defined(__arm32__) /* - * On the arm32, the jmpbuf regs underwent a name change after NetBSD 1.3. - */ -#ifdef JMPBUF_REG_R13 -#define JB_SP_INDEX JMPBUF_REG_R13 -#else -#define JB_SP_INDEX _JB_REG_R13 +** Initialize a thread context to run "_main()" when started +*/ +#ifdef __i386__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[2] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[0] = (int) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[2] #endif -#else -#error "Need to define SP index in jmp_buf here" +#ifdef __sparc__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[2] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[3] = (int) _main; \ + CONTEXT(_thread)[4] = (int) _main + 4; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[2] +#endif +#ifdef __powerpc__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[3] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[4] = (int) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[3] +#endif +#ifdef __m68k__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[2] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[5] = (int) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[2] +#endif +#ifdef __mips__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[32] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[2] = (int) _main; \ + CONTEXT(_thread)[28] = (int) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[32] +#endif +#ifdef __arm32__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[23] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[24] = (int) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[23] +#endif +#ifdef __alpha__ +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ +{ \ + sigsetjmp(CONTEXT(_thread), 1); \ + CONTEXT(_thread)[34] = (unsigned char*) ((_sp) - 128); \ + CONTEXT(_thread)[2] = (long) _main; \ + CONTEXT(_thread)[30] = (long) _main; \ + CONTEXT(_thread)[31] = (long) _main; \ + *status = PR_TRUE; \ +} +#define _MD_GET_SP(_thread) CONTEXT(_thread)[34] +#endif +#ifndef _MD_INIT_CONTEXT +#error "Need to define _MD_INIT_CONTEXT for this platform" #endif -#define _MD_GET_SP(_th) (_th)->md.context[JB_SP_INDEX] #define PR_NUM_GCREGS _JBLEN -/* -** Initialize a thread context to run "_main()" when started -*/ -#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ -{ \ - *status = PR_TRUE; \ - if (sigsetjmp(CONTEXT(_thread), 1)) { \ - _main(); \ - } \ - _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \ -} - #define _MD_SWITCH_CONTEXT(_thread) \ if (!sigsetjmp(CONTEXT(_thread), 1)) { \ (_thread)->md.errcode = errno; \ @@ -210,7 +272,10 @@ struct _MDCPU { * unwrapped version. */ #define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv) +#if defined(_PR_POLL_AVAILABLE) +#include <poll.h> #define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout) +#endif #if NetBSD1_3 == 1L typedef unsigned int nfds_t; diff --git a/pr/include/md/_nto.cfg b/pr/include/md/_nto.cfg index dd3a5aef..cae799f7 100644 --- a/pr/include/md/_nto.cfg +++ b/pr/include/md/_nto.cfg @@ -27,6 +27,8 @@ #define NTO #endif +#define PR_AF_INET6 24 /* same as AF_INET6 */ + #ifdef __i386__ #define IS_LITTLE_ENDIAN 1 diff --git a/pr/include/md/_nto.h b/pr/include/md/_nto.h index c3720ab3..c23d9f8a 100644 --- a/pr/include/md/_nto.h +++ b/pr/include/md/_nto.h @@ -46,6 +46,9 @@ #define PR_HAVE_POSIX_NAMED_SHARED_MEMORY #define _PR_HAVE_POSIX_SEMAPHORES +#define FD_SETSIZE 4096 +#include <sys/time.h> +#include <sys/types.h> #include <sys/select.h> #undef HAVE_STACK_GROWING_UP @@ -190,9 +193,6 @@ struct _MDCPU { ** We wrapped the select() call. _MD_SELECT refers to the built-in, ** unwrapped version. */ -#include <sys/time.h> -#include <sys/types.h> -#include <sys/select.h> #define _MD_SELECT select #endif /* nspr_nto_defs_h___ */ diff --git a/pr/include/md/_openbsd.cfg b/pr/include/md/_openbsd.cfg index ae3bfcda..994daf32 100644 --- a/pr/include/md/_openbsd.cfg +++ b/pr/include/md/_openbsd.cfg @@ -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 diff --git a/pr/include/md/_openvms.cfg b/pr/include/md/_openvms.cfg index b9dd6d97..17548c27 100644 --- a/pr/include/md/_openvms.cfg +++ b/pr/include/md/_openvms.cfg @@ -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 diff --git a/pr/include/md/_openvms.h b/pr/include/md/_openvms.h index 6f888b72..e79d4a79 100644 --- a/pr/include/md/_openvms.h +++ b/pr/include/md/_openvms.h @@ -40,6 +40,7 @@ #define _PR_VMBASE 0x30000000 #define _PR_STACK_VMBASE 0x50000000 #define _MD_DEFAULT_STACK_SIZE 131072L +#define _MD_MINIMUM_STACK_SIZE 131072L /* ** This is not defined on OpenVMS. I believe its only used in GC code, and @@ -81,6 +82,36 @@ struct ip_mreq { #define _PR_STAT_HAS_ONLY_ST_ATIME #define _PR_NO_LARGE_FILES +/* IPv6 support */ +#define _PR_HAVE_SOCKADDR_LEN +#define _PR_HAVE_GETIPNODEBYNAME +#define _PR_HAVE_GETIPNODEBYADDR +#define _PR_INET6_PROBE +#ifndef _PR_INET6 +#define AF_INET6 26 +#define AI_V4MAPPED 0x00000010 +#define AI_ALL 0x00000008 +#define AI_ADDRCONFIG 0x00000020 +#endif + +#define _PR_HAVE_MD_SOCKADDR_IN6 +/* if we have a quadword field defined in the structure, then its length */ +/* will be a multiple of 8, and connect() won't accept 32 (it wants 28) */ +struct _md_in6_addr { + union { + PRUint8 _S6_u8[16]; + PRUint16 _S6_u16[8]; + PRUint32 _S6_u32[4]; + } _S6_un; +}; +struct _md_sockaddr_in6 { + PRUint16 sin6_family; + PRUint16 sin6_port; + PRUint32 sin6_flowinfo; + struct _md_in6_addr sin6_addr; + PRUint32 sin6_scope_id; +}; + #undef USE_SETJMP #include <setjmp.h> diff --git a/pr/include/md/_os2.cfg b/pr/include/md/_os2.cfg index f72eab69..a11e7cf3 100644 --- a/pr/include/md/_os2.cfg +++ b/pr/include/md/_os2.cfg @@ -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 diff --git a/pr/include/md/_os2.h b/pr/include/md/_os2.h index 70e8d112..c08202e9 100644 --- a/pr/include/md/_os2.h +++ b/pr/include/md/_os2.h @@ -251,7 +251,14 @@ extern PRInt32 _MD_CloseSocket(PRInt32 osfd); #define _MD_GETPEERNAME (_PR_MD_GETPEERNAME) #define _MD_GETSOCKOPT (_PR_MD_GETSOCKOPT) #define _MD_SETSOCKOPT (_PR_MD_SETSOCKOPT) + +#ifdef XP_OS2_EMX +extern PRInt32 _MD_SELECT(int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout); +#else #define _MD_SELECT select +#endif + #define _MD_FSYNC _PR_MD_FSYNC #define _MD_SET_FD_INHERITABLE (_PR_MD_SET_FD_INHERITABLE) @@ -325,10 +332,10 @@ extern PRInt32 _MD_Accept(PRFileDesc *fd, PRNetAddr *raddr, PRUint32 *rlen, #define _PR_LOCK _MD_LOCK #define _PR_UNLOCK _MD_UNLOCK -#define _MD_NEW_LOCK(lock) (DosCreateMutexSem(0, &((lock)->mutex), 0, 0),(lock)->notified.length=0,(lock)->notified.link=NULL,PR_SUCCESS) -#define _MD_FREE_LOCK(lock) DosCloseMutexSem(((lock)->mutex)) -#define _MD_LOCK(lock) DosRequestMutexSem(((lock)->mutex), SEM_INDEFINITE_WAIT) -#define _MD_TEST_AND_LOCK(lock) (DosRequestMutexSem(((lock)->mutex), SEM_INDEFINITE_WAIT),PR_SUCCESS) +#define _MD_NEW_LOCK (_PR_MD_NEW_LOCK) +#define _MD_FREE_LOCK (_PR_MD_FREE_LOCK) +#define _MD_LOCK (_PR_MD_LOCK) +#define _MD_TEST_AND_LOCK (_PR_MD_TEST_AND_LOCK) #define _MD_UNLOCK (_PR_MD_UNLOCK) /* --- lock and cv waiting --- */ diff --git a/pr/include/md/_pth.h b/pr/include/md/_pth.h index 6e2e90c0..2fe641ff 100644 --- a/pr/include/md/_pth.h +++ b/pr/include/md/_pth.h @@ -93,7 +93,7 @@ #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \ || defined(HPUX) || defined(LINUX) || defined(FREEBSD) \ || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \ - || defined(VMS) || defined(NTO) + || defined(VMS) || defined(NTO) || defined(RHAPSODY) #define _PT_PTHREAD_ZERO_THR_HANDLE(t) (t) = 0 #define _PT_PTHREAD_THR_HANDLE_IS_ZERO(t) (t) == 0 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st) @@ -204,7 +204,7 @@ #define PT_PRIO_MIN 1 #define PT_PRIO_MAX 127 #elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ - || defined(BSDI) /* XXX */ + || defined(BSDI) || defined(RHAPSODY) /* XXX */ #define PT_PRIO_MIN 0 #define PT_PRIO_MAX 126 #else @@ -237,7 +237,7 @@ extern int (*_PT_aix_yield_fcn)(); PR_END_MACRO #elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \ || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \ - || defined(BSDI) || defined(NTO) + || defined(BSDI) || defined(NTO) || defined(RHAPSODY) #define _PT_PTHREAD_YIELD() sched_yield() #else #error "Need to define _PT_PTHREAD_YIELD for this platform" diff --git a/pr/include/md/_rhapsody.cfg b/pr/include/md/_rhapsody.cfg index 87a76c95..33da779e 100644 --- a/pr/include/md/_rhapsody.cfg +++ b/pr/include/md/_rhapsody.cfg @@ -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 diff --git a/pr/include/md/_rhapsody.h b/pr/include/md/_rhapsody.h index d97e6a3c..98a2f1ed 100644 --- a/pr/include/md/_rhapsody.h +++ b/pr/include/md/_rhapsody.h @@ -42,8 +42,8 @@ #define USE_MACH_DYLD #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC -#define _PR_TIMESPEC_HAS_TS_SEC #define _PR_NO_LARGE_FILES +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #define USE_SETJMP diff --git a/pr/include/md/_solaris.h b/pr/include/md/_solaris.h index 081636e0..88c5a44e 100644 --- a/pr/include/md/_solaris.h +++ b/pr/include/md/_solaris.h @@ -70,8 +70,13 @@ #define _PR_POLL_AVAILABLE #define _PR_USE_POLL #define _PR_STAT_HAS_ST_ATIM +#ifdef SOLARIS2_5 +#define _PR_HAVE_SYSV_SEMAPHORES +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY +#else #define _PR_HAVE_POSIX_SEMAPHORES #define PR_HAVE_POSIX_NAMED_SHARED_MEMORY +#endif #define _PR_HAVE_GETIPNODEBYNAME #define _PR_HAVE_GETIPNODEBYADDR #define _PR_INET6_PROBE @@ -81,6 +86,24 @@ #define AI_V4MAPPED 0x0001 #define AI_ALL 0x0002 #define AI_ADDRCONFIG 0x0004 +#define _PR_HAVE_MD_SOCKADDR_IN6 +/* isomorphic to struct in6_addr on Solaris 8 */ +struct _md_in6_addr { + union { + PRUint8 _S6_u8[16]; + PRUint32 _S6_u32[4]; + PRUint32 __S6_align; + } _S6_un; +}; +/* isomorphic to struct sockaddr_in6 on Solaris 8 */ +struct _md_sockaddr_in6 { + PRUint16 sin6_family; + PRUint16 sin6_port; + PRUint32 sin6_flowinfo; + struct _md_in6_addr sin6_addr; + PRUint32 sin6_scope_id; + PRUint32 __sin6_src_id; +}; #endif #include "prinrval.h" diff --git a/pr/include/obsolete/.cvsignore b/pr/include/obsolete/.cvsignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/pr/include/obsolete/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/pr/include/obsolete/Makefile b/pr/include/obsolete/Makefile deleted file mode 100644 index 2aba1bae..00000000 --- a/pr/include/obsolete/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.1 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -#! gmake - -MOD_DEPTH = ../../.. - -include $(MOD_DEPTH)/config/config.mk - -HEADERS = $(wildcard *.h) - -RELEASE_HEADERS = $(HEADERS) -RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/obsolete - -include $(MOD_DEPTH)/config/rules.mk - -export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include/obsolete -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL)/obsolete -endif diff --git a/pr/include/obsolete/Makefile.in b/pr/include/obsolete/Makefile.in index 1f7fc4b4..fd33428b 100644 --- a/pr/include/obsolete/Makefile.in +++ b/pr/include/obsolete/Makefile.in @@ -31,10 +31,9 @@ HEADERS = $(wildcard $(srcdir)/*.h) RELEASE_HEADERS = $(HEADERS) RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/obsolete +includedir := $(includedir)/obsolete + include $(topsrcdir)/config/rules.mk export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include/obsolete -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL)/obsolete -endif + $(INSTALL) -m 444 $(RELEASE_HEADERS) $(dist_includedir)/obsolete diff --git a/pr/include/obsolete/protypes.h b/pr/include/obsolete/protypes.h index 631137e4..23be3aa2 100644 --- a/pr/include/obsolete/protypes.h +++ b/pr/include/obsolete/protypes.h @@ -51,7 +51,8 @@ typedef PRIntn intn; /* SVR4 typedef of uint is commonly found on UNIX machines. */ #ifdef XP_UNIX #include <sys/types.h> -#else +#endif +#if !defined(XP_UNIX) || defined(NTO) typedef PRUintn uint; #endif diff --git a/pr/include/prcmon.h b/pr/include/prcmon.h index 1cb21cce..073db78b 100644 --- a/pr/include/prcmon.h +++ b/pr/include/prcmon.h @@ -72,7 +72,7 @@ NSPR_API(PRStatus) PR_CNotifyAll(void *address); ** Set a callback to be invoked each time a monitor is recycled from the cache ** freelist, with the monitor's cache-key passed in address. */ -NSPR_API(void) PR_CSetOnMonitorRecycle(void (*callback)(void *address)); +NSPR_API(void) PR_CSetOnMonitorRecycle(void (PR_CALLBACK *callback)(void *address)); PR_END_EXTERN_C diff --git a/pr/include/prinet.h b/pr/include/prinet.h index 440352ed..994ce806 100644 --- a/pr/include/prinet.h +++ b/pr/include/prinet.h @@ -75,7 +75,7 @@ struct sockaddr_dl; * socket headers. */ #if defined(OS2) && !defined(INADDR_LOOPBACK) -#define INADDR_LOOPBACK gethostid() +#define INADDR_LOOPBACK 0x7f000001 #endif /* diff --git a/pr/include/prinit.h b/pr/include/prinit.h index 500182c3..dd319360 100644 --- a/pr/include/prinit.h +++ b/pr/include/prinit.h @@ -44,11 +44,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** "<major version>.<minor version> <build date>" */ -#define PR_VERSION "4.0" +#define PR_VERSION "4.0.2 Beta" #define PR_VMAJOR 4 #define PR_VMINOR 0 -#define PR_VPATCH 0 -#define PR_BETA PR_FALSE +#define PR_VPATCH 2 +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/pr/include/prio.h b/pr/include/prio.h index 36017128..015e9be2 100644 --- a/pr/include/prio.h +++ b/pr/include/prio.h @@ -179,34 +179,6 @@ union PRNetAddr { }; /* -** 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 diff --git a/pr/include/private/.cvsignore b/pr/include/private/.cvsignore new file mode 100644 index 00000000..f3c7a7c5 --- /dev/null +++ b/pr/include/private/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/pr/include/private/Makefile b/pr/include/private/Makefile deleted file mode 100644 index 25c6909a..00000000 --- a/pr/include/private/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.1 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -#! gmake - -MOD_DEPTH = ../../.. - -include $(MOD_DEPTH)/config/config.mk - -RELEASE_HEADERS = pprio.h pprthred.h prpriv.h -RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/private - -HEADERS = $(RELEASE_HEADERS) pprmwait.h primpl.h - -include $(MOD_DEPTH)/config/rules.mk - -export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include/private -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL)/private -endif diff --git a/pr/include/private/Makefile.in b/pr/include/private/Makefile.in index 4197dbb5..8325ef72 100644 --- a/pr/include/private/Makefile.in +++ b/pr/include/private/Makefile.in @@ -32,10 +32,9 @@ RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)/private HEADERS = $(RELEASE_HEADERS) $(srcdir)/pprmwait.h $(srcdir)/primpl.h +includedir := $(includedir)/private + include $(topsrcdir)/config/rules.mk export:: $(RELEASE_HEADERS) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(DIST)/include/private -ifeq ($(MOZ_BITS),16) - $(INSTALL) -m 444 $(RELEASE_HEADERS) $(MOZ_INCL)/private -endif + $(INSTALL) -m 444 $(RELEASE_HEADERS) $(dist_includedir)/private diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index 926c2585..8c1d3e12 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -172,6 +172,14 @@ struct _PT_Notified (thr->interrupt_blocked = 1) #define _PT_THREAD_UNBLOCK_INTERRUPT(thr) \ (thr->interrupt_blocked = 0) + +#ifdef GC_LEAK_DETECTOR +/* All threads are GCable. */ +#define _PT_IS_GCABLE_THREAD(thr) 1 +#else +#define _PT_IS_GCABLE_THREAD(thr) ((thr)->state & PT_THREAD_GCABLE) +#endif /* GC_LEAK_DETECTOR */ + /* ** Possible values for thread's suspend field ** Note that the first two can be the same as they are really mutually exclusive, @@ -1268,6 +1276,69 @@ 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) + +#elif defined(_PR_HAVE_MD_SOCKADDR_IN6) + +/* +** Under the following conditions: +** 1. _PR_INET6 is not defined; +** 2. _PR_INET6_PROBE is defined; +** 3. struct sockaddr_in6 has nonstandard fields at the end +** (e.g., on Solaris 8), +** (_addr)->ipv6 is smaller than struct sockaddr_in6, and +** hence we can't pass sizeof((_addr)->ipv6) to socket +** functions such as connect because they would fail with +** EINVAL. +** +** To pass the correct socket address length to socket +** functions, define the macro _PR_HAVE_MD_SOCKADDR_IN6 and +** define struct _md_sockaddr_in6 to be isomorphic to +** struct sockaddr_in6. +*/ + +#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(struct _md_sockaddr_in6) \ + : sizeof((_addr)->local))) +#else +#define PR_NETADDR_SIZE(_addr) \ + ((_addr)->raw.family == PR_AF_INET \ + ? sizeof((_addr)->inet) \ + : sizeof(struct _md_sockaddr_in6) +#endif /* defined(XP_UNIX) */ + +#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( diff --git a/pr/include/prthread.h b/pr/include/prthread.h index ebf0cc33..6ec53499 100644 --- a/pr/include/prthread.h +++ b/pr/include/prthread.h @@ -116,7 +116,7 @@ typedef enum PRThreadPriority ** PR_USER_THREAD to exit then the process exits. */ NSPR_API(PRThread*) PR_CreateThread(PRThreadType type, - void (*start)(void *arg), + void (PR_CALLBACK *start)(void *arg), void *arg, PRThreadPriority priority, PRThreadScope scope, diff --git a/pr/include/prtime.h b/pr/include/prtime.h index 9f1f6ae0..7a670942 100644 --- a/pr/include/prtime.h +++ b/pr/include/prtime.h @@ -136,7 +136,7 @@ typedef struct PRExplodedTime { * to GMT before applying the DST rules. */ -typedef PRTimeParameters (PR_CALLBACK_DECL *PRTimeParamFn)(const PRExplodedTime *gmt); +typedef PRTimeParameters (PR_CALLBACK *PRTimeParamFn)(const PRExplodedTime *gmt); /**********************************************************************/ /****************************** FUNCTIONS *****************************/ diff --git a/pr/include/prtypes.h b/pr/include/prtypes.h index 02ea6412..b84682ca 100644 --- a/pr/include/prtypes.h +++ b/pr/include/prtypes.h @@ -158,13 +158,9 @@ #define PR_IMPLEMENT(__type) __type #define PR_EXTERN_DATA(__type) extern __type #define PR_IMPLEMENT_DATA(__type) __type -#define PR_CALLBACK +#define PR_CALLBACK _Optlink #define PR_CALLBACK_DECL -#ifndef XP_OS2_VACPP -#define PR_STATIC_CALLBACK(__x) static __x -#else -#define PR_STATIC_CALLBACK(__x) static __x _Optlink -#endif +#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK #else /* Unix */ |