File STLport-4.6.2-gcc4.patch of Package libstlport_gcc4

--- STLport-4.6.2/src/gcc-mingw32.mak	2003-11-02 09:58:51.000000000 +0100
+++ STLport-4.6.2/src/gcc-mingw32.mak	2009-05-14 14:56:40.000000000 +0200
@@ -3,6 +3,8 @@
 #
 CC = gcc
 CXX = c++
+WINDRES = windres
+AR = ar
 
 #
 # Basename for libraries
@@ -13,8 +15,8 @@
 # guts for common stuff
 #
 #
-LINK=ar crv
-DYN_LINK=c++ -shared -o
+LINK=$(AR) crv
+DYN_LINK=$(CXX) -shared -o
 
 OBJEXT=o
 DYNEXT=dll
@@ -50,13 +52,13 @@
 
 LDFLAGS_RELEASE_static =
 # LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}  -Wl,--no-undefined, -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${RELEASE_NAME}.a
-LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}  -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${RELEASE_NAME}.a
+LDFLAGS_RELEASE_dynamic = ${CXXFLAGS_RELEASE_dynamic}  -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${RELEASE_NAME}.${DYNEXT}.${STEXT}
 
 LDFLAGS_DEBUG_static =
-LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}  -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${DEBUG_NAME}.a
+LDFLAGS_DEBUG_dynamic = ${CXXFLAGS_DEBUG_dynamic}  -Wl,--export-all-symbols -Wl,-d -Wl,--out-implib,${OUTDIR}/${DEBUG_NAME}.${DYNEXT}.${STEXT}
 
 LDFLAGS_STLDEBUG_static =
-LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,--export-all-symbols -Wl,--out-implib,${OUTDIR}/${STLDEBUG_NAME}.a
+LDFLAGS_STLDEBUG_dynamic = ${CXXFLAGS_STLDEBUG_dynamic} -Wl,--export-all-symbols -Wl,--out-implib,${OUTDIR}/${STLDEBUG_NAME}.${DYNEXT}.${STEXT}
 
 
 include common_percent_rules.mak
@@ -64,13 +66,13 @@
 
 
 ${RESFILE}: stlport.rc
-	windres -O coff --define COMP=${COMP} --define BUILD= -o $(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
+	$(WINDRES) -O coff --define COMP=${COMP} --define BUILD= -o $(RELEASE_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
 
 ${RESFILE_debug}: stlport.rc
-	windres -O coff --define COMP=${COMP} --define BUILD=_DEBUG -o $(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
+	$(WINDRES) -O coff --define COMP=${COMP} --define BUILD=_DEBUG -o $(DEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
 
 ${RESFILE_stldebug}: stlport.rc
-	windres -O coff --define COMP=${COMP} --define BUILD=_STLDEBUG -o $(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
+	$(WINDRES) -O coff --define COMP=${COMP} --define BUILD=_STLDEBUG -o $(STLDEBUG_OBJDIR_dynamic)$(PATH_SEP)stlport.o stlport.rc
 
 #%.s: %.cpp
 #	$(CXX) $(CXXFLAGS) -O4 -S -pto $<  -o $@
--- STLport-4.6.2/src/num_get_float.cpp	2003-11-02 09:58:50.000000000 +0100
+++ STLport-4.6.2/src/num_get_float.cpp	2009-05-14 14:00:04.000000000 +0200
@@ -770,18 +770,18 @@
 
 void  _STLP_CALL
 __string_to_float(const string& v, float& val) {
-    val = _Stl_string_to_double(v.data());
+    val = _Stl_string_to_double(v.c_str());
 }
 
 void  _STLP_CALL
 __string_to_float(const string& v, double& val) {
-    val = _Stl_string_to_double(v.data());
+    val = _Stl_string_to_double(v.c_str());
 }
 
 #ifndef _STLP_NO_LONG_DOUBLE
 void  _STLP_CALL
 __string_to_float(const string& v, long double& val) {
-    val = _Stl_string_to_long_double(v.data());
+    val = _Stl_string_to_long_double(v.c_str());
 }
 #endif
 
--- STLport-4.6.2/src/time_facets.cpp	2003-11-02 09:58:50.000000000 +0100
+++ STLport-4.6.2/src/time_facets.cpp	2009-05-14 14:00:04.000000000 +0200
@@ -268,7 +268,7 @@
 #ifdef __GNUC__
 
       // fbp : at least on SUN 
-# if defined ( _STLP_UNIX ) && ! defined (__linux__)
+# if defined ( _STLP_UNIX ) && ! defined (__linux__) && !defined(__GLIBC__)
 #  define __USE_BSD 1
 # endif
  
--- STLport-4.6.2/stlport/config/stl_como.h	2003-11-02 09:59:11.000000000 +0100
+++ STLport-4.6.2/stlport/config/stl_como.h	2009-05-14 14:00:04.000000000 +0200
@@ -63,7 +63,7 @@
 //
 
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 
 #   define _STLP_NO_NATIVE_MBSTATE_T      1
 #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
--- STLport-4.6.2/stlport/config/stl_gcc.h	2003-11-02 09:59:11.000000000 +0100
+++ STLport-4.6.2/stlport/config/stl_gcc.h	2009-05-14 14:00:04.000000000 +0200
@@ -3,7 +3,7 @@
  */
 
 /* Systems having GLIBC installed have different traits */
-#if ! defined (_STLP_USE_GLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
+#if ! defined (_STLP_USE_GLIBC) && ( defined (__linux__) || defined(__GLIBC__) || defined (__CYGWIN__) )
 # define _STLP_USE_GLIBC
 #endif
 
@@ -87,7 +87,7 @@
 #endif
 #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
 #   define _STLP_NO_NATIVE_WIDE_STREAMS   1
-# elif defined(__linux__)
+# elif defined(__linux__) || defined(__GLIBC__)
 #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
 #   define _STLP_NO_NATIVE_WIDE_STREAMS   1
 # elif defined (__sun)
@@ -267,7 +267,7 @@
 #   define _STLP_NATIVE_INCLUDE_PATH ../g++-v3
 #   define _STLP_NATIVE_OLD_STREAMS_INCLUDE_PATH ../g++-v3/backward
 #  else
-#   if defined(__GNUC_PATCHLEVEL__) && (__GNUC_PATCHLEVEL__ > 0)
+#   if defined(__GNUC_PATCHLEVEL__)
 #     define _STLP_NATIVE_INCLUDE_PATH ../__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__
 #     define _STLP_NATIVE_OLD_STREAMS_INCLUDE_PATH ../__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__/backward
 #   else
--- STLport-4.6.2/stlport/config/stl_kai.h	2003-11-02 09:59:11.000000000 +0100
+++ STLport-4.6.2/stlport/config/stl_kai.h	2009-05-14 14:00:04.000000000 +0200
@@ -41,7 +41,7 @@
 
 // this is multiplatform compiler, so here should go system-dependant section
 // This really should be in platform-specific files, like stl_solaris.h
-# ifdef __linux__
+# if defined(__linux__) || defined(__GLIBC__)
 #  define _STLP_NO_NATIVE_WIDE_STREAMS 1
 #  define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
 # elif defined (__sun) || defined (sun)
--- STLport-4.6.2/stlport/cstdlib	2003-11-02 09:59:01.000000000 +0100
+++ STLport-4.6.2/stlport/cstdlib	2009-05-14 14:00:04.000000000 +0200
@@ -69,10 +69,12 @@
 #endif
 using _STLP_VENDOR_CSTD::bsearch;
 using _STLP_VENDOR_CSTD::qsort;
+#if 0 /* see Debian bug #434691 */
 // boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs 
 # ifdef _STLP_HAS_NATIVE_FLOAT_ABS 
 using _STLP_VENDOR_CSTD::abs;
 # endif
+#endif
 using _STLP_VENDOR_CSTD::div;
 using _STLP_VENDOR_CSTD::labs;
 using _STLP_VENDOR_CSTD::ldiv;
--- STLport-4.6.2/stlport/stdexcept	2003-11-02 09:59:01.000000000 +0100
+++ STLport-4.6.2/stlport/stdexcept	2009-05-14 14:00:04.000000000 +0200
@@ -53,6 +53,10 @@
 
 _STLP_BEGIN_NAMESPACE
 
+#if (__GNUC__ >= 3)
+#define _STLP_NOTHROW_INHERENTLY throw()
+#endif
+
 # if   ! defined (_STLP_NO_EXCEPTION_HEADER)
 # if !defined(_STLP_EXCEPTION_BASE) && !defined(_STLP_BROKEN_EXCEPTION_CLASS) && defined (_STLP_USE_NAMESPACES) && defined (_STLP_USE_OWN_NAMESPACE)
 using _STLP_VENDOR_EXCEPT_STD::exception;
--- STLport-4.6.2/stlport/stl/_alloc.h	2003-11-02 09:59:08.000000000 +0100
+++ STLport-4.6.2/stlport/stl/_alloc.h	2009-05-14 14:00:04.000000000 +0200
@@ -413,7 +413,7 @@
 {
   typedef _Allocator _Orig;
 # if defined (_STLP_USE_NESTED_TCLASS_THROUGHT_TPARAM) 
-  typedef typename _Allocator::_STLP_TEMPLATE rebind<_Tp> _Rebind_type;
+  typedef typename _Allocator::template _STLP_TEMPLATE rebind<_Tp> _Rebind_type;
   typedef typename _Rebind_type::other  allocator_type;
   static allocator_type create_allocator(const _Orig& __a) { return allocator_type(__a); }
 # else
@@ -457,7 +457,7 @@
 template <class _Tp, class _Alloc>
 inline _STLP_TYPENAME_ON_RETURN_TYPE _Alloc_traits<_Tp, _Alloc>::allocator_type  _STLP_CALL
 __stl_alloc_create(const _Alloc& __a, const _Tp*) {
-  typedef typename _Alloc::_STLP_TEMPLATE rebind<_Tp>::other _Rebound_type;
+  typedef typename _Alloc::template _STLP_TEMPLATE rebind<_Tp>::other _Rebound_type;
   return _Rebound_type(__a);
 }
 #else
--- STLport-4.6.2/stlport/stl/c_locale.h	2003-11-02 09:59:03.000000000 +0100
+++ STLport-4.6.2/stlport/stl/c_locale.h	2009-05-14 14:00:04.000000000 +0200
@@ -226,7 +226,7 @@
 #  define _Locale_PRINT _PRINT
 #  define _Locale_ALPHA (_UPPER|_LOWER)
 
-# elif defined(_STLP_USE_GLIBC) /* linux, using the gnu compiler */
+# elif defined(_STLP_USE_GLIBC) /* glibc, using the gnu compiler */
 
 /* This section uses macros defined in the gnu libc ctype.h header */
 
--- STLport-4.6.2/stlport/stl/_config.h	2004-02-05 00:29:55.000000000 +0100
+++ STLport-4.6.2/stlport/stl/_config.h	2009-05-14 14:00:04.000000000 +0200
@@ -166,9 +166,9 @@
 # endif
 
 /* Operating system recognition (basic) */
-# if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX)  || defined (__NetBSD__) || defined (__Lynx__)
+# if defined (__unix) || defined (__linux__) || defined(__GLIBC__) || defined (__QNX__) || defined (_AIX)  || defined (__NetBSD__) || defined (__Lynx__)
 #  define _STLP_UNIX 1
-#  if defined (__linux__) && ! defined (_STLP_USE_GLIBC)
+#  if (defined (__linux__) || defined(__GLIBC__)) && ! defined (_STLP_USE_GLIBC)
 #   define _STLP_USE_GLIBC 1
 #  endif
 # elif defined(macintosh) || defined (_MAC)
@@ -262,7 +262,7 @@
 #    define _STLP_DEC_THREADS
 #   elif defined (_STLP_WIN32) && ! defined (_STLP_PTHREADS)
 #    define _STLP_WIN32THREADS 1
-#   elif ((defined (__sun) && !defined (__linux__)) \
+#   elif ((defined (__sun) && !defined (__linux__) && !defined(__GLIBC__)) \
      || defined(_UITHREADS) ) && !defined(_STLP_PTHREADS)
 #     define _STLP_UITHREADS
 #   elif defined (__OS2__)
@@ -280,12 +280,12 @@
 #  endif /* _REENTRANT */
 
 // warning : pthread_spinlock code was reported not to work on RedHat 3
-# if defined(__linux__) && defined(_STLP_USE_PTHREAD_SPINLOCK)
+# if (defined(__linux__) || defined(__GLIBC__)) && defined(_STLP_USE_PTHREAD_SPINLOCK)
 #  include <features.h>
 #  ifndef __USE_XOPEN2K
 #   undef _STLP_USE_PTHREAD_SPINLOCK
 #  endif /* __USE_XOPEN2K */
-# endif /* __linux__ && _STLP_PTHREADS */
+# endif /* (__linux__ || __GLIBC__) && _STLP_PTHREADS */
 
 # ifndef _STLP_STATIC_MUTEX
 #  define _STLP_STATIC_MUTEX _STLP_mutex_base
--- STLport-4.6.2/stlport/stl/_threads.h	2004-03-10 22:25:29.000000000 +0100
+++ STLport-4.6.2/stlport/stl/_threads.h	2009-05-14 14:14:58.000000000 +0200
@@ -177,7 +177,7 @@
 #    endif
 #   endif
 
-#if (_MSC_VER >= 1300) || defined (_STLP_NEW_PLATFORM_SDK)
+#if (_MSC_VER >= 1300) || defined (_STLP_NEW_PLATFORM_SDK) || defined(__MINGW32__)
 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedIncrement(long volatile *);
 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedDecrement(long volatile *);
 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedExchange(long volatile *, long);
openSUSE Build Service is sponsored by