diff options
author | cvs2hg <devnull@localhost> | 2008-12-20 06:26:36 +0000 |
---|---|---|
committer | cvs2hg <devnull@localhost> | 2008-12-20 06:26:36 +0000 |
commit | 6a8a79ae8f1d44f44ec493cac1b7812145c1733c (patch) | |
tree | 576dbce159a6a399f7bedbba5762f45613383472 | |
parent | df159ae6a36865ac9f7fd11624f5bac602323afd (diff) | |
download | nspr-hg-6a8a79ae8f1d44f44ec493cac1b7812145c1733c.tar.gz |
fixup commit for branch 'NSPR_4_7_BRANCH'
-rw-r--r-- | config/prdepend.h | 1 | ||||
-rw-r--r-- | pr/include/md/_darwin.h | 1 | ||||
-rw-r--r-- | pr/include/md/_netbsd.cfg | 106 | ||||
-rw-r--r-- | pr/include/md/_netbsd.h | 12 | ||||
-rw-r--r-- | pr/src/linking/prlink.c | 16 | ||||
-rw-r--r-- | pr/src/md/windows/ntinrval.c | 21 | ||||
-rw-r--r-- | pr/src/pthreads/ptsynch.c | 2 |
7 files changed, 113 insertions, 46 deletions
diff --git a/config/prdepend.h b/config/prdepend.h index df72c568..55444c40 100644 --- a/config/prdepend.h +++ b/config/prdepend.h @@ -42,3 +42,4 @@ */ #error "Do not include this header file." + diff --git a/pr/include/md/_darwin.h b/pr/include/md/_darwin.h index 0d4e6ce3..fc377984 100644 --- a/pr/include/md/_darwin.h +++ b/pr/include/md/_darwin.h @@ -72,6 +72,7 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC #define _PR_HAVE_LARGE_OFF_T +#define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #define _PR_INET6 diff --git a/pr/include/md/_netbsd.cfg b/pr/include/md/_netbsd.cfg index cb4e6262..4a638382 100644 --- a/pr/include/md/_netbsd.cfg +++ b/pr/include/md/_netbsd.cfg @@ -52,7 +52,8 @@ #define HAVE_LONG_LONG #endif -#if defined(__i386__) || defined(__arm32__) || defined(__MIPSEL__) +#if defined(__i386__) || defined(__arm32__) || defined(__ARMEL__) || \ + defined(__MIPSEL__) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN @@ -97,12 +98,58 @@ #define PR_ALIGN_OF_DOUBLE 4 #define PR_ALIGN_OF_POINTER 4 -#elif defined(__sparc__) || defined(__MIPSEB__) +#elif defined(__sparc_v9__) -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#define HAVE_ALIGNED_DOUBLES -#define HAVE_ALIGNED_LONGLONGS +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 + +#elif defined(__sparc__) || defined(__MIPSEB__) || defined(__ARMEB__) + +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS #define PR_BYTES_PER_BYTE 1 #define PR_BYTES_PER_SHORT 2 @@ -188,6 +235,53 @@ #define PR_BYTES_PER_WORD_LOG2 3 #define PR_BYTES_PER_DWORD_LOG2 3 +#elif defined(__amd64__) +#define IS_LITTLE_ENDIAN 1 +#undef IS_BIG_ENDIAN +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + #elif defined(__powerpc__) || defined(__m68k__) #undef IS_LITTLE_ENDIAN diff --git a/pr/include/md/_netbsd.h b/pr/include/md/_netbsd.h index db25bd89..bf57a4f5 100644 --- a/pr/include/md/_netbsd.h +++ b/pr/include/md/_netbsd.h @@ -47,6 +47,8 @@ #define _PR_SI_ARCHITECTURE "x86" #elif defined(__alpha__) #define _PR_SI_ARCHITECTURE "alpha" +#elif defined(__amd64__) +#define _PR_SI_ARCHITECTURE "amd64" #elif defined(__m68k__) #define _PR_SI_ARCHITECTURE "m68k" #elif defined(__powerpc__) @@ -92,12 +94,6 @@ #define _PR_INET6_PROBE #endif -#if __NetBSD_Version__ >= 106370000 -/* NetBSD 1.6ZK */ -#define _PR_HAVE_GETPROTO_R -#define _PR_HAVE_GETPROTO_R_INT -#endif - #define USE_SETJMP #ifndef _PR_PTHREADS @@ -243,6 +239,10 @@ struct _MDCPU { #endif /* ! _PR_PTHREADS */ +extern void _MD_EarlyInit(void); +extern PRIntervalTime _PR_UNIX_GetInterval(void); +extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); + #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit #define _MD_GET_INTERVAL _PR_UNIX_GetInterval diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c index c2d2d731..016eadeb 100644 --- a/pr/src/linking/prlink.c +++ b/pr/src/linking/prlink.c @@ -223,15 +223,7 @@ static int pr_ConvertUTF16toUTF8(LPCWSTR wname, LPSTR name, int len); /************************************************************************/ #if !defined(USE_DLFCN) && !defined(HAVE_STRERROR) -static char* errStrBuf = NULL; #define ERR_STR_BUF_LENGTH 20 -static char* errno_string(PRIntn oserr) -{ - if (errStrBuf == NULL) - errStrBuf = PR_MALLOC(ERR_STR_BUF_LENGTH); - PR_snprintf(errStrBuf, ERR_STR_BUF_LENGTH, "error %d", oserr); - return errStrBuf; -} #endif static void DLLErrorInternal(PRIntn oserr) @@ -247,7 +239,9 @@ static void DLLErrorInternal(PRIntn oserr) #elif defined(HAVE_STRERROR) error = strerror(oserr); /* this should be okay */ #else - error = errno_string(oserr); + char errStrBuf[ERR_STR_BUF_LENGTH]; + PR_snprintf(errStrBuf, sizeof(errStrBuf), "error %d", oserr); + error = errStrBuf; #endif if (NULL != error) PR_SetErrorText(strlen(error), error); @@ -382,10 +376,6 @@ void _PR_ShutdownLinker(void) free(_pr_currentLibPath); _pr_currentLibPath = NULL; } - -#if !defined(USE_DLFCN) && !defined(HAVE_STRERROR) - PR_DELETE(errStrBuf); -#endif } #endif diff --git a/pr/src/md/windows/ntinrval.c b/pr/src/md/windows/ntinrval.c index f96c27b5..b8d85831 100644 --- a/pr/src/md/windows/ntinrval.c +++ b/pr/src/md/windows/ntinrval.c @@ -42,34 +42,15 @@ #include "primpl.h" -#ifdef WINCE -typedef DWORD (*IntervalFuncType)(void); -static IntervalFuncType intervalFunc; -#endif - void _PR_MD_INTERVAL_INIT() { -#ifdef WINCE - HMODULE mmtimerlib = LoadLibraryW(L"mmtimer.dll"); /* XXX leaked! */ - if (mmtimerlib) { - intervalFunc = (IntervalFuncType)GetProcAddress(mmtimerlib, - "timeGetTime"); - } else { - intervalFunc = &GetTickCount; - } -#endif } PRIntervalTime _PR_MD_GET_INTERVAL() { - /* milliseconds since system start */ -#ifdef WINCE - return (*intervalFunc)(); -#else - return timeGetTime(); -#endif + return timeGetTime(); /* milliseconds since system start */ } PRIntervalTime diff --git a/pr/src/pthreads/ptsynch.c b/pr/src/pthreads/ptsynch.c index 93b54880..eb2040b6 100644 --- a/pr/src/pthreads/ptsynch.c +++ b/pr/src/pthreads/ptsynch.c @@ -812,7 +812,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *name) */ #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \ - || defined(SYMBIAN) + || defined(DARWIN) || defined(SYMBIAN) /* union semun is defined by including <sys/sem.h> */ #else /* according to X/OPEN we have to define it ourselves */ |