Skip to content

Commit

Permalink
Bug 1162780 - Update NSPR to NSPR_4_10_9_BETA2. r=ted
Browse files Browse the repository at this point in the history
  • Loading branch information
jld committed Jul 22, 2015
1 parent 471bfe3 commit cd59bd0
Show file tree
Hide file tree
Showing 24 changed files with 481 additions and 44 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
@@ -1 +1 @@
NSPR_4_10_8_RTM
NSPR_4_10_9_BETA2
1 change: 1 addition & 0 deletions nsprpub/config/prdepend.h
Expand Up @@ -10,3 +10,4 @@
*/

#error "Do not include this header file."

37 changes: 36 additions & 1 deletion nsprpub/configure
Expand Up @@ -2489,7 +2489,7 @@ test -n "$target_alias" &&
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10
MOD_PATCH_VERSION=8
MOD_PATCH_VERSION=9
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
Expand Down Expand Up @@ -2666,6 +2666,19 @@ fi
if test -n "$gonkdir" ; then
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
$as_echo "#define ANDROID 1" >>confdefs.h
else
Expand Down Expand Up @@ -2750,6 +2763,19 @@ $as_echo "$android_platform" >&6; }
CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
$as_echo "#define ANDROID 1" >>confdefs.h
;;
Expand Down Expand Up @@ -4595,6 +4621,12 @@ test -n "$HOST_CC" || HOST_CC=""""
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOST_CC" >&5
$as_echo "$HOST_CC" >&6; }
if test -z "$HOST_CFLAGS"; then
HOST_CFLAGS="$CFLAGS"
fi
if test -z "$HOST_LDFLAGS"; then
HOST_LDFLAGS="$LDFLAGS"
fi
CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
Expand Down Expand Up @@ -6552,6 +6584,7 @@ fi
fi
ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
if test "x$ac_cv_header_crt_externs_h" = xyes; then :
$as_echo "#define HAVE_CRT_EXTERNS_H 1" >>confdefs.h
fi
Expand Down Expand Up @@ -7284,6 +7317,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
$as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
Expand Down
39 changes: 37 additions & 2 deletions nsprpub/configure.in
Expand Up @@ -16,7 +16,7 @@ dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10
MOD_PATCH_VERSION=8
MOD_PATCH_VERSION=9
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
Expand Down Expand Up @@ -160,6 +160,20 @@ AC_ARG_WITH(gonk,
if test -n "$gonkdir" ; then
dnl Most things are directly configured by env vars when building for gonk

dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi

AC_DEFINE(ANDROID)
else
case "$target" in
Expand Down Expand Up @@ -243,6 +257,20 @@ case "$target" in
CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"

dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi

AC_DEFINE(ANDROID)
;;
esac
Expand Down Expand Up @@ -625,6 +653,12 @@ if test "$target" != "$host"; then
AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
AC_MSG_RESULT([$HOST_CC])
if test -z "$HOST_CFLAGS"; then
HOST_CFLAGS="$CFLAGS"
fi
if test -z "$HOST_LDFLAGS"; then
HOST_LDFLAGS="$LDFLAGS"
fi

CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
Expand Down Expand Up @@ -1378,7 +1412,7 @@ case "$target" in
if test "`echo $CC | grep -c '\-arch '`" = "0"; then
CC="$CC -arch $CPU_ARCH"
fi
AC_CHECK_HEADER(crt_externs.h)
AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H))
DSO_CFLAGS=-fPIC
DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
_OPTIMIZE_FLAGS=-O2
Expand Down Expand Up @@ -2086,6 +2120,7 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(XP_UNIX)
AC_DEFINE(NETBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
Expand Down
48 changes: 48 additions & 0 deletions nsprpub/pr/include/md/_linux.cfg
Expand Up @@ -508,6 +508,52 @@
#error "Unknown MIPS endianness."
#endif

#ifdef _ABI64

#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

#else /* _ABI64 */

#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
Expand Down Expand Up @@ -548,6 +594,8 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3

#endif /* _ABI64 */

#elif defined(__arm__)

#ifdef __ARMEB__
Expand Down
30 changes: 30 additions & 0 deletions nsprpub/pr/include/prenv.h
Expand Up @@ -113,6 +113,36 @@ NSPR_API(char*) PR_GetEnv(const char *var);
*/
NSPR_API(PRStatus) PR_SetEnv(const char *string);

/*
** PR_DuplicateEnvironment() -- Obtain a copy of the environment.
**
** Description:
** PR_DuplicateEnvironment() copies the environment so that it can be
** modified without changing the current process's environment, and
** then passed to interfaces such as POSIX execve(). In particular,
** this avoids needing to allocate memory or take locks in the child
** after a fork(); neither of these is allowed by POSIX after a
** multithreaded process calls fork(), and PR_SetEnv does both.
**
** Inputs:
** none
**
** Returns:
** A pointer to a null-terminated array of null-terminated strings,
** like the traditional global variable "environ". The array and
** the strings are allocated with PR_Malloc(), and it is the
** caller's responsibility to free them.
**
** In case of memory allocation failure, or if the operating system
** doesn't support reading the entire environment through the global
** variable "environ" or similar, returns NULL instead.
**
** Restrictions:
** Similarly to PR_GetEnv(), this function may not interoperate as
** expected with the operating system's native environment accessors.
*/
NSPR_API(char **) PR_DuplicateEnvironment(void);

PR_END_EXTERN_C

#endif /* prenv_h___ */
6 changes: 3 additions & 3 deletions nsprpub/pr/include/prinit.h
Expand Up @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.10.8"
#define PR_VERSION "4.10.9 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 10
#define PR_VPATCH 8
#define PR_BETA PR_FALSE
#define PR_VPATCH 9
#define PR_BETA PR_TRUE

/*
** PRVersionCheck
Expand Down
3 changes: 2 additions & 1 deletion nsprpub/pr/include/prlog.h
Expand Up @@ -157,7 +157,8 @@ NSPR_API(void) PR_LogPrint(const char *fmt, ...);
*/
NSPR_API(void) PR_LogFlush(void);

NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);
NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln)
PR_PRETEND_NORETURN;

#if defined(DEBUG) || defined(FORCE_PR_LOG)
#define PR_LOGGING 1
Expand Down
10 changes: 5 additions & 5 deletions nsprpub/pr/include/prtime.h
Expand Up @@ -248,14 +248,14 @@ NSPR_API(PRStatus) PR_ParseTimeString (

/* Format a time value into a buffer. Same semantics as strftime() */
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
const PRExplodedTime *tm);
const PRExplodedTime *time);

/* Format a time value into a buffer. Time is always in US English format, regardless
* of locale setting.
/* Format a time value into a buffer. Time is always in US English format,
* regardless of locale setting.
*/
NSPR_API(PRUint32)
PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
const char* format, const PRExplodedTime* tm );
PR_FormatTimeUSEnglish(char *buf, PRUint32 bufSize,
const char *format, const PRExplodedTime *time);

PR_END_EXTERN_C

Expand Down
25 changes: 25 additions & 0 deletions nsprpub/pr/include/prtypes.h
Expand Up @@ -510,6 +510,31 @@ typedef long PRWord;
typedef unsigned long PRUword;
#endif

/*
* PR_PRETEND_NORETURN, specified at the end of a function declaration,
* indicates that for the purposes of static analysis, this function does not
* return. (The function definition does not need to be annotated.)
*
* void PR_Assert(const char *s, const char *file, PRIntn ln)
* PR_PRETEND_NORETURN;
*
* Some static analyzers, like scan-build from clang, can use this information
* to eliminate false positives. From the upstream documentation of
* scan-build:
* This attribute is useful for annotating assertion handlers that actually
* can return, but for the purpose of using the analyzer we want to pretend
* that such functions do not return.
*/
#ifdef __clang_analyzer__
#if __has_extension(attribute_analyzer_noreturn)
#define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn))
#endif
#endif

#ifndef PR_PRETEND_NORETURN
#define PR_PRETEND_NORETURN /* no support */
#endif

#if defined(NO_NSPR_10_SUPPORT)
#else
/********* ???????????????? FIX ME ??????????????????????????? *****/
Expand Down
1 change: 0 additions & 1 deletion nsprpub/pr/src/io/prfdcach.c
Expand Up @@ -213,7 +213,6 @@ void _PR_InitFdCache(void)
void _PR_CleanupFdCache(void)
{
PRFileDesc *fd, *next;
PRStackElem *pop;

for (fd = _pr_fd_cache.head; fd != NULL; fd = next)
{
Expand Down
1 change: 1 addition & 0 deletions nsprpub/pr/src/io/prmwait.c
Expand Up @@ -475,6 +475,7 @@ static PRStatus _MW_PollInternal(PRWaitGroup *group)
PR_Lock(group->ml);
if (_prmw_running != group->state)
{
PR_DELETE(poll_list);
PR_SetError(PR_INVALID_STATE_ERROR, 0);
goto aborted;
}
Expand Down

0 comments on commit cd59bd0

Please sign in to comment.