Author: faridz
Date: Fri Sep 29 06:06:27 2006
New Revision: 451275

URL: http://svn.apache.org/viewvc?view=rev&rev=451275
Log:
2006-09-29 Farid Zaripov <[EMAIL PROTECTED]>

        * _num_put.cc (__rw_iter_failed): Removed const to resolve
        ambiguity on MSVC 7.0
        * _select.h [_RWSTD_NO_CLASS_PARTIAL_SPEC]: Added __rw_is_same
        for compilers which not support the partial template specialization
        * file.cpp: Declare fileno() only if it not declared in CRT header,
        but present in libc
        * NEW_THROWS.cpp: Returned 1 if operator new doesn't throws

Modified:
    incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp
    incubator/stdcxx/trunk/include/loc/_num_put.cc
    incubator/stdcxx/trunk/include/rw/_select.h
    incubator/stdcxx/trunk/src/file.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp?view=diff&rev=451275&r1=451274&r2=451275
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/NEW_THROWS.cpp Fri Sep 29 06:06:27 
2006
@@ -115,7 +115,5 @@
         return 0;
     }
 
-    printf ("#define _RWSTD_NO_NEW_THROWS\n");
-
-    return 0;
+    return 1;
 }

Modified: incubator/stdcxx/trunk/include/loc/_num_put.cc
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/loc/_num_put.cc?view=diff&rev=451275&r1=451274&r2=451275
==============================================================================
--- incubator/stdcxx/trunk/include/loc/_num_put.cc (original)
+++ incubator/stdcxx/trunk/include/loc/_num_put.cc Fri Sep 29 06:06:27 2006
@@ -42,13 +42,15 @@
 inline bool
 __rw_iter_failed (const _OutputIter&) { return false; }
 
+// const commented to resolve ambiguity on MSVC 7.0:
+// error C2667: '__rw_iter_failed' : none of 2 overloads have a best conversion
 template <class _CharT, class _Traits>
 inline bool
-__rw_iter_failed (const _STD::ostreambuf_iterator<_CharT, _Traits> &__it)
+__rw_iter_failed (/*const */_STD::ostreambuf_iterator<_CharT, _Traits> &__it)
 {
     return __it.failed ();
 }
-
+

 }   // namespace __rw
 
 

Modified: incubator/stdcxx/trunk/include/rw/_select.h
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_select.h?view=diff&rev=451275&r1=451274&r2=451275
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_select.h (original)
+++ incubator/stdcxx/trunk/include/rw/_select.h Fri Sep 29 06:06:27 2006
@@ -90,6 +90,8 @@
 #endif
 
 
+#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
+
 template <class _TypeT, class _TypeU>
 struct __rw_is_same
 {
@@ -97,8 +99,6 @@
     enum { _C_val };
 };
 
-#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
-
 template <class _TypeT>
 struct __rw_is_same<_TypeT, _TypeT>
 {
@@ -108,23 +108,35 @@
 
 #else   // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
 
-_RWSTD_SPECIALIZED_CLASS
-struct __rw_is_same<char, char>
+template <bool flag>
+struct __rw_bool_t
 {
-    typedef __rw_true_t _C_type;
-    enum { _C_val = 1 };
+    typedef __rw_false_t _C_type;
 };
 
-#  ifndef _RWSTD_NO_WCHAR_T
-
 _RWSTD_SPECIALIZED_CLASS
-struct __rw_is_same<wchar_t, wchar_t>
+struct __rw_bool_t<true>
 {
     typedef __rw_true_t _C_type;
-    enum { _C_val = 1 };
 };
 
-#  endif   // _RWSTD_NO_WCHAR_T
+template <class _TypeT, class _TypeU>
+struct __rw_is_same
+{
+    struct yes {};
+    struct no { yes no_ [2]; };
+    template <class T>
+    struct Type {};
+
+    static yes test (Type<_TypeT>, Type<_TypeT>);
+    static no test (...);
+
+    enum { _C_val = sizeof (test (Type<_TypeT> (),
+                                  Type<_TypeU> ())) == sizeof (yes) };
+
+    typedef _TYPENAME __rw_bool_t<_C_val>::_C_type _C_type;
+};
+
 #endif   // _RWSTD_NO_CLASS_PARTIAL_SPEC
 
 

Modified: incubator/stdcxx/trunk/src/file.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/file.cpp?view=diff&rev=451275&r1=451274&r2=451275
==============================================================================
--- incubator/stdcxx/trunk/src/file.cpp (original)
+++ incubator/stdcxx/trunk/src/file.cpp Fri Sep 29 06:06:27 2006
@@ -2,7 +2,7 @@
  *
  * support.cpp - definition of support functions and objects
  *
- * $Id: //stdlib/dev/source/stdlib/file.cpp#3 $
+ * $Id$
  *
  ***************************************************************************
  *
@@ -78,12 +78,18 @@
 #endif   // _RWSTD_NO_MKSTEMP[_IN_LIBC]
 
 
+#if defined (_RWSTD_NO_FILENO) && !defined (_RWSTD_NO_FILENO_IN_LIBC)
+
 // declare fileno in case it's not declared (for strict ANSI conformance)
 extern "C" {
 
 _RWSTD_DLLIMPORT int (fileno)(FILE*) _LIBC_THROWS ();
 
+#  undef _RWSTD_NO_FILENO
+
 }   // extern "C"
+
+#endif   // _RWSTD_NO_FILENO && !_RWSTD_NO_FILENO_IN_LIBC
 
 
 _RWSTD_NAMESPACE (__rw) {


Reply via email to