Fixed build errors originated from stlport

The STLPort in the Android repository is the latest version and there
has not been any more updates to this project. Thus, we are locally
patching STLPort to fix build errors reported by clang.
 - Introduced _STLP_UNUSED macro to fix un-used param warnings. (caused
   build errors with -Werror)

Author: Tareq A. Siraj <tareq.a.siraj@intel.com>
Reviewed-by: Ariel Bernal <ariel.j.bernal@intel.com>

(cherry picked from commit a721beb6d7372334152406a36e8db016650a9691)

Change-Id: Ibd8ff94a5df24e0c12a362aa645cb7b24f84280c
diff --git a/stlport/stl/_algo.c b/stlport/stl/_algo.c
index b58b92d..c1b1921 100644
--- a/stlport/stl/_algo.c
+++ b/stlport/stl/_algo.c
@@ -1354,7 +1354,7 @@
 template <class _ForwardIter, class _Tp,
           class _Compare1, class _Compare2, class _Distance>
 _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
-                           _Compare1 __comp1, _Compare2 __comp2, _Distance*) {
+                           _Compare1 _STLP_UNUSED(__comp1), _Compare2 __comp2, _Distance*) {
   _Distance __len = _STLP_STD::distance(__first, __last);
   _Distance __half;
 
diff --git a/stlport/stl/_algobase.c b/stlport/stl/_algobase.c
index 157e25c..2748dfb 100644
--- a/stlport/stl/_algobase.c
+++ b/stlport/stl/_algobase.c
@@ -326,7 +326,7 @@
 template <class _InputIter, class _ForwardIter, class _Tp1, class _Tp2>
 inline _InputIter __find_first_of_aux1(_InputIter __first1, _InputIter __last1,
                                        _ForwardIter __first2, _ForwardIter __last2,
-                                       _Tp1* __pt1, _Tp2* __pt2) {
+                                       _Tp1* _STLP_UNUSED(__pt1), _Tp2* __pt2) {
   typedef _STLP_TYPENAME _STLP_STD::_IsIntegral<_Tp1>::_Ret _IsIntegral;
   typedef _STLP_TYPENAME _STLP_PRIV _IsCharLikeType<_Tp2>::_Ret _IsCharLike;
   typedef _STLP_TYPENAME _STLP_STD::_Land2<_IsIntegral, _IsCharLike>::_Ret _UseStrcspnLikeAlgo;
@@ -451,7 +451,7 @@
 
 template <class _ForwardIter, class _Tp, class _Compare1, class _Compare2, class _Distance>
 _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
-                           _Compare1 __comp1, _Compare2 __comp2, _Distance*) {
+                           _Compare1 __comp1, _Compare2 _STLP_UNUSED(__comp2), _Distance*) {
   _Distance __len = _STLP_STD::distance(__first, __last);
   _Distance __half;
   _ForwardIter __middle;
diff --git a/stlport/stl/_alloc.h b/stlport/stl/_alloc.h
index 09b8af5..245e0db 100644
--- a/stlport/stl/_alloc.h
+++ b/stlport/stl/_alloc.h
@@ -292,7 +292,7 @@
 #endif
   allocator(const allocator<_Tp>&) _STLP_NOTHROW {}
 #if !defined (_STLP_NO_MOVE_SEMANTIC)
-  allocator(__move_source<allocator<_Tp> > src) _STLP_NOTHROW {}
+  allocator(__move_source<allocator<_Tp> > _STLP_UNUSED(src)) _STLP_NOTHROW {}
 #endif
   ~allocator() _STLP_NOTHROW {}
   pointer address(reference __x) const {return &__x;}
diff --git a/stlport/stl/_string.c b/stlport/stl/_string.c
index ae55092..2320d83 100644
--- a/stlport/stl/_string.c
+++ b/stlport/stl/_string.c
@@ -110,7 +110,7 @@
 template <class _InputIter, class _CharT, class _Tp, class _Traits>
 inline _InputIter __str_find_first_not_of_aux2(_InputIter __first1, _InputIter __last1,
                                                const _CharT* __first2, const _CharT* __last2,
-                                               _Tp* __pt, _Traits* __traits) {
+                                               _Tp* _STLP_UNUSED(__pt), _Traits* __traits) {
   typedef typename _IsIntegral<_Tp>::_Ret _IsIntegral;
   typedef typename _IsCharLikeType<_CharT>::_Ret _IsCharLike;
   typedef typename _Land2<_IsIntegral, _IsCharLike>::_Ret _UseStrcspnLikeAlgo;
diff --git a/stlport/stl/_threads.c b/stlport/stl/_threads.c
index ea3c0b9..b79e188 100644
--- a/stlport/stl/_threads.c
+++ b/stlport/stl/_threads.c
@@ -73,7 +73,7 @@
 
 template <int __inst>
 void _STLP_CALL
-_STLP_mutex_spin<__inst>::_S_nsec_sleep(int __log_nsec, unsigned int& __iteration) {
+_STLP_mutex_spin<__inst>::_S_nsec_sleep(int __log_nsec, unsigned int& _STLP_UNUSED(__iteration)) {
 #  if defined (_STLP_WIN32THREADS)
 #    if defined (_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
   if (__iteration <= 4000) {
@@ -115,7 +115,7 @@
 
 template <int __inst>
 void  _STLP_CALL
-_STLP_mutex_spin<__inst>::_M_do_lock(volatile __stl_atomic_t* __lock) {
+_STLP_mutex_spin<__inst>::_M_do_lock(volatile __stl_atomic_t* _STLP_UNUSED(__lock)) {
 #  if defined(_STLP_ATOMIC_EXCHANGE)
   if (_Atomic_swap(__lock, 1)) {
     unsigned __my_spin_max = _STLP_mutex_spin<0>::__max;
diff --git a/stlport/stl/config/features.h b/stlport/stl/config/features.h
index c1eb53c..5928ded 100644
--- a/stlport/stl/config/features.h
+++ b/stlport/stl/config/features.h
@@ -62,6 +62,12 @@
  */
 #include <stl/config/user_config.h>
 
+#ifdef __GNUC__
+#  define _STLP_UNUSED(x) x __attribute__((unused))
+#else
+#  define _STLP_UNUSED(x) x
+#endif /* __GNUC__ */
+
 #if defined (_STLP_DEBUG) && !defined (_STLP_DEBUG_LEVEL)
 #  define _STLP_DEBUG_LEVEL _STLP_STLPORT_DBG_LEVEL
 #endif