From a6ca66e5306c274648ff73e1978a2b6b00591a80 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Thu, 8 Jan 2015 13:52:22 -0800 Subject: [PATCH] Bug 1073003 - Create an stlport modifications patch and update README.mozilla r=nfroyd (on a CLOSED TREE) --- build/stlport/README.mozilla | 3 + build/stlport/fix-warnings-as-errors.patch | 70 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 build/stlport/fix-warnings-as-errors.patch diff --git a/build/stlport/README.mozilla b/build/stlport/README.mozilla index dddf18c03717..ca2500f41f8a 100644 --- a/build/stlport/README.mozilla +++ b/build/stlport/README.mozilla @@ -7,3 +7,6 @@ The overrides/ directory contains Mozilla-specific overrides to the standard The following patches are applied on top: - android-mozilla-config.patch: Adjusts Android-specific configuration to the mozilla codebase use of the STL. + +- fix-warnings-as-errors.patch: Fixes warnings which were causing the + B2G emulator-ICS build to fail (related to bug 1073003). diff --git a/build/stlport/fix-warnings-as-errors.patch b/build/stlport/fix-warnings-as-errors.patch new file mode 100644 index 000000000000..ae6f8b2ad17d --- /dev/null +++ b/build/stlport/fix-warnings-as-errors.patch @@ -0,0 +1,70 @@ +# HG changeset patch +# Parent f89b28ea7c7b7fcb54c34e74fcb047626300bfba +# User Dave Hylands +Bug 1073003 - Fix warnings in stlport causing errors in emulator build. + +diff --git a/build/stlport/stlport/stl/_istream.c b/build/stlport/stlport/stl/_istream.c +--- a/build/stlport/stlport/stl/_istream.c ++++ b/build/stlport/stlport/stl/_istream.c +@@ -1140,17 +1140,16 @@ basic_istream<_CharT, _Traits>::ignore(s + template + basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __delim) { + sentry __sentry(*this, _No_Skip_WS()); + this->_M_gcount = 0; + + if (__sentry) { + basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); +- typedef _STLP_PRIV _Constant_unary_fun _Const_bool; + typedef _STLP_PRIV _Constant_binary_fun + _Const_streamsize; + const streamsize __maxss = (numeric_limits::max)(); + + if (__n == (numeric_limits::max)()) { + if (__buf->gptr() != __buf->egptr()) + _M_gcount = _M_ignore_buffered(this, __buf, + __maxss, _Const_streamsize(__maxss), +diff --git a/build/stlport/stlport/stl/_slist.c b/build/stlport/stlport/stl/_slist.c +--- a/build/stlport/stlport/stl/_slist.c ++++ b/build/stlport/stlport/stl/_slist.c +@@ -143,17 +143,16 @@ void _Slist_unique(slist<_Tp, _Alloc>& _ + } + } + } + + template + void _Slist_merge(slist<_Tp, _Alloc>& __that, slist<_Tp, _Alloc>& __x, + _StrictWeakOrdering __comp) { + typedef _Slist_node<_Tp> _Node; +- typedef _STLP_PRIV _Slist_node_base _Node_base; + if (__that.get_allocator() == __x.get_allocator()) { + typename slist<_Tp, _Alloc>::iterator __ite(__that.before_begin()); + while (__ite._M_node->_M_next && !__x.empty()) { + if (__comp(__x.front(), __STATIC_CAST(_Node*, __ite._M_node->_M_next)->_M_data)) { + _STLP_VERBOSE_ASSERT(!__comp(__STATIC_CAST(_Node*, __ite._M_node->_M_next)->_M_data, __x.front()), + _StlMsg_INVALID_STRICT_WEAK_PREDICATE) + __that.splice_after(__ite, __x, __x.before_begin()); + } +diff --git a/build/stlport/stlport/stl/config/features.h b/build/stlport/stlport/stl/config/features.h +--- a/build/stlport/stlport/stl/config/features.h ++++ b/build/stlport/stlport/stl/config/features.h +@@ -303,17 +303,18 @@ + # undef _STLP_NO_DEFAULT_NON_TYPE_PARAM + # define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1 + #endif + + #if !defined (_STLP_STATIC_ASSERT) + /* Some compiler support 0 size array so we use negative size array to generate + * a compilation time error. + */ +-# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1]; ++//# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1]; ++# define _STLP_STATIC_ASSERT(expr) static_assert(expr, "static_assert failed"); + #endif + + /* apple mpw exception handling bug */ + #ifndef _STLP_MPWFIX_TRY + # define _STLP_MPWFIX_TRY + #endif + #ifndef _STLP_MPWFIX_CATCH + # define _STLP_MPWFIX_CATCH