stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r448928 - in /incubator/stdcxx/trunk: etc/config/src/ include/ include/rw/ tests/include/ tests/utilities/
Date Fri, 22 Sep 2006 13:43:18 GMT
Author: faridz
Date: Fri Sep 22 06:43:18 2006
New Revision: 448928

URL: http://svn.apache.org/viewvc?view=rev&rev=448928
Log:
2006-09-22 Farid Zaripov <faridz@kyiv.vdiweb.com>

	* limits [_RWSTD_NO_CLASS_PARTIAL_SPEC]: Corrected macro _RWSTD_SPECIALIZE_LIMITS
	* rw_char.h (UserInt): Added const_cast to avoid MSVC 7.0 error "C2446: '=='
	: no conversion from 'const int *' to 'void *const '"
	* _autoptr.h (__rw_nonvoid_ref): Added #ifndef _RWSTD_NO_CV_VOID_SPECIALIZATIONS/#endif
	to avoid error on MSVC 7.0 (http://www.dotnet247.com/247reference/msgs/1/7727.aspx)
	* _specialized.h (__rw_construct) [_RWSTD_NO_PART_SPEC_OVERLOAD]: Added code to deal
	with compilers, which are not supports the "Partial Ordering of Function Templates"
	* VA_LIST.cpp (va_list_array_size) [_RWSTD_NO_CLASS_PARTIAL_SPEC && _RWSTD_NO_PART_SPEC_OVERLOAD]:
	Added code to deal with compilers, which are not supports the "Partial Ordering of Function
Templates"
	* CV_VOID_SPECIALIZATIONS.cpp: New file, checking for cv qualifiers on type void
	* 20.operators.cpp: Added #include <cstddef> for std::size_t
	* 20.pairs.cpp: Added #ifdef/#endif guard to avoid error "Cannot access private copy constructor"

Added:
    incubator/stdcxx/trunk/etc/config/src/CV_VOID_SPECIALIZATIONS.cpp
Modified:
    incubator/stdcxx/trunk/etc/config/src/VA_LIST.cpp
    incubator/stdcxx/trunk/include/limits
    incubator/stdcxx/trunk/include/rw/_autoptr.h
    incubator/stdcxx/trunk/include/rw/_specialized.h
    incubator/stdcxx/trunk/tests/include/rw_char.h
    incubator/stdcxx/trunk/tests/utilities/20.operators.cpp
    incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp

Added: incubator/stdcxx/trunk/etc/config/src/CV_VOID_SPECIALIZATIONS.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/CV_VOID_SPECIALIZATIONS.cpp?view=auto&rev=448928
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/CV_VOID_SPECIALIZATIONS.cpp (added)
+++ incubator/stdcxx/trunk/etc/config/src/CV_VOID_SPECIALIZATIONS.cpp Fri Sep 22 06:43:18
2006
@@ -0,0 +1,24 @@
+// checking for cv qualifiers on type void
+
+#include "config.h"
+
+#ifdef _RWSTD_NO_NEW_CLASS_TEMPLATE_SYNTAX
+#  define _RWSTD_SPECIALIZED_CLASS
+#else
+#  define _RWSTD_SPECIALIZED_CLASS template<>
+#endif
+
+template <class T>
+struct S {};
+
+_RWSTD_SPECIALIZED_CLASS
+struct S<void> {};
+
+_RWSTD_SPECIALIZED_CLASS
+struct S<const void> {};
+
+_RWSTD_SPECIALIZED_CLASS
+struct S<volatile void> {};
+
+_RWSTD_SPECIALIZED_CLASS
+struct S<const volatile void> {};

Modified: incubator/stdcxx/trunk/etc/config/src/VA_LIST.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/VA_LIST.cpp?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/VA_LIST.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/VA_LIST.cpp Fri Sep 22 06:43:18 2006
@@ -51,7 +51,7 @@
 
 const char* get_type_name (...) { return 0; }
 
-#if 1 // ndef _RWSTD_NO_CLASS_PARTIAL_SPEC
+#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
 
 template <class T>
 struct Type {
@@ -79,6 +79,8 @@
 
 #else   // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
 
+#ifndef _RWSTD_NO_PART_SPEC_OVERLOAD
+
 template <class T>
 int va_list_array_size_imp (T *va)
 {
@@ -95,6 +97,38 @@
 {
     return va_list_array_size_imp (&va);
 }
+
+#else   // if defined (_RWSTD_NO_PART_SPEC_OVERLOAD)
+
+template <class T>
+class is_array
+{ 
+    class yes {};
+
+    class no { yes yes_ [2]; };
+
+    template <class U> struct Type {};
+
+    template <class U, size_t N>
+    static yes test (Type<U[N]>);
+    static no test (...);
+
+public:
+    enum { value = sizeof (test (Type<T> ())) == sizeof (yes) };
+};
+
+template <class T>
+int va_list_array_size_imp (T **va)
+{
+    return sizeof (va_list) / sizeof **va;
+}
+
+int va_list_array_size (va_list va)
+{
+    return is_array<va_list>::value ? va_list_array_size_imp (&va) : 0;
+}
+
+#endif  // _RWSTD_NO_PART_SPEC_OVERLOAD
 
 template <class T>
 const char* va_list_type (T *va)

Modified: incubator/stdcxx/trunk/include/limits
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/limits?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/include/limits (original)
+++ incubator/stdcxx/trunk/include/limits Fri Sep 22 06:43:18 2006
@@ -7,16 +7,23 @@
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -243,16 +250,16 @@
   _RWSTD_CLASS_END
 #else   // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
     // define specializations for all cv-qualified types
-#  define _RWSTD_SPECIALIZE_LIMITS(T, cpfx)                     \
-  _RWSTD_CLASS_BEGIN (numeric_limits<T>)                        \
-      _RWSTD_LIMITS_BODY (T, cpfx)                              \
-  _RWSTD_CLASS_END;                                             \
-  _RWSTD_SPECIALIZED_CLASS                                      \
-  numeric_limits<const T>: numeric_limits<T> { };               \
-  _RWSTD_SPECIALIZED_CLASS                                      \
-  numeric_limits<volatile T>: numeric_limits<T> { };            \
-  _RWSTD_SPECIALIZED_CLASS                                      \
-  numeric_limits<const volatile T>: numeric_limits<T> { }
+#  define _RWSTD_SPECIALIZE_LIMITS(T, cpfx)                                \
+  _RWSTD_CLASS_BEGIN (numeric_limits<T>)                                   \
+      _RWSTD_LIMITS_BODY (T, cpfx)                                         \
+  _RWSTD_CLASS_END                                                         \
+  _RWSTD_CLASS_BEGIN (numeric_limits<const T>: numeric_limits<T>)          \
+  _RWSTD_CLASS_END                                                         \
+  _RWSTD_CLASS_BEGIN (numeric_limits<volatile T>: numeric_limits<T>)       \
+  _RWSTD_CLASS_END                                                         \
+  _RWSTD_CLASS_BEGIN (numeric_limits<const volatile T>: numeric_limits<T>) \
+  _RWSTD_CLASS_END
 #endif   // _RWSTD_NO_CLASS_PARTIAL_SPEC
 
 

Modified: incubator/stdcxx/trunk/include/rw/_autoptr.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_autoptr.h?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_autoptr.h (original)
+++ incubator/stdcxx/trunk/include/rw/_autoptr.h Fri Sep 22 06:43:18 2006
@@ -10,22 +10,23 @@
  *
  ***************************************************************************
  *
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
  *
- * Copyright 1994-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -56,6 +57,8 @@
     typedef void _C_ref;
 };
 
+#ifndef _RWSTD_NO_CV_VOID_SPECIALIZATIONS
+
 _RWSTD_SPECIALIZED_CLASS
 struct __rw_nonvoid_ref<const void>
 {
@@ -74,6 +77,7 @@
     typedef void _C_ref;
 };
 
+#endif  // _RWSTD_NO_CV_VOID_SPECIALIZATIONS
 
 }   // namespace __rw
 

Modified: incubator/stdcxx/trunk/include/rw/_specialized.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_specialized.h?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_specialized.h (original)
+++ incubator/stdcxx/trunk/include/rw/_specialized.h Fri Sep 22 06:43:18 2006
@@ -10,35 +10,25 @@
  *
  ***************************************************************************
  *
- * Copyright 2005-2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
  *
- * Copyright 2001-2006 Rogue Wave Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ***************************************************************************
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
  *
- * Copyright (c) 1994
- * Hewlett-Packard Company
+ * Copyright 1994-2006 Rogue Wave Software.
  *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.  Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied warranty.
+ * Copyright (c) 1994 Hewlett-Packard Company
  *
  **************************************************************************/
 
@@ -76,6 +66,8 @@
 #undef _RWSTD_CONTAINER_SIZE_TYPE
 
 
+#ifndef _RWSTD_NO_PART_SPEC_OVERLOAD
+
 template <class _TypeT, class _TypeU>
 inline void
 __rw_construct (_TypeT* __p, const _TypeU& __val)
@@ -92,6 +84,25 @@
     __rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
 }
 
+#else   // #ifdef _RWSTD_NO_PART_SPEC_OVERLOAD
+
+template <class _TypeT, class _TypeU>
+inline void
+__rw_construct_impl (_TypeT* __p, const _TypeU& __val)
+{
+    ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val);
+}
+
+
+template <class _TypeT, class _TypeU>
+inline void
+__rw_construct (volatile _TypeT* __p, const _TypeU& __val)
+{
+    // remove volatile before invoking operator new
+    __rw_construct_impl (_RWSTD_CONST_CAST (_TypeT*, __p), __val);
+}
+
+#endif  // _RWSTD_NO_PART_SPEC_OVERLOAD
 
 template <class _TypeT>
 inline void

Modified: incubator/stdcxx/trunk/tests/include/rw_char.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/include/rw_char.h?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/tests/include/rw_char.h (original)
+++ incubator/stdcxx/trunk/tests/include/rw_char.h Fri Sep 22 06:43:18 2006
@@ -122,7 +122,10 @@
 
     UserInt (const UserInt &rhs)
         : ptr_ (&i_), i_ (rhs.i_) {
-        RW_ASSERT (rhs.ptr_ == &rhs.i_);             // verify rhs is valid 
+        // verify rhs is valid 
+        // const_cast used to avoid MSVC 7.0 error C2446:
+        // '==' : no conversion from 'const int *' to 'void *const '
+        RW_ASSERT (_RWSTD_CONST_CAST (const void*, rhs.ptr_) == &rhs.i_);
         RW_ASSERT (-1 <= rhs.i_  && rhs.i_ < 257);   // i may be invalid
     }
 
@@ -130,7 +133,8 @@
     // for extra robustness
     void operator= (const UserInt &rhs) {
         RW_ASSERT (ptr_     == &i_);                // verify *this is valid
-        RW_ASSERT (rhs.ptr_ == &rhs.i_);            // verify rhs is valid
+        // verify rhs is valid
+        RW_ASSERT (_RWSTD_CONST_CAST (const void*, rhs.ptr_) == &rhs.i_);
         RW_ASSERT (-1 <= i_     && i_     < 257);   // i may be invalid
         RW_ASSERT (-1 <  rhs.i_ && rhs.i_ < 257);   // rhs.i must ve valid
 
@@ -166,8 +170,10 @@
     }
 
     bool equal (const UserInt &rhs) const {
-        RW_ASSERT (ptr_     == &i_);               // verify *this is valid
-        RW_ASSERT (rhs.ptr_ == &rhs.i_);           // verify rhs is valid
+        // verify *this is valid
+        RW_ASSERT (_RWSTD_CONST_CAST (const void*, ptr_) == &i_);
+        // verify rhs is valid
+        RW_ASSERT (_RWSTD_CONST_CAST (const void*, rhs.ptr_) == &rhs.i_);
         RW_ASSERT (-1 < i_     && i_     < 257);   // i must ve valid
         RW_ASSERT (-1 < rhs.i_ && rhs.i_ < 257);   // rhs.i must be valid
 

Modified: incubator/stdcxx/trunk/tests/utilities/20.operators.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/utilities/20.operators.cpp?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/tests/utilities/20.operators.cpp (original)
+++ incubator/stdcxx/trunk/tests/utilities/20.operators.cpp Fri Sep 22 06:43:18 2006
@@ -6,16 +6,23 @@
  *
  ***************************************************************************
  *
- * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
- * Software division. Licensed under the Apache License, Version 2.0 (the
- * "License");  you may  not use this file except  in compliance with the
- * License.    You    may   obtain   a   copy   of    the   License    at
- * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
- * applicable law  or agreed to  in writing,  software  distributed under
- * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
- * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
- * for the specific language governing permissions  and limitations under
- * the License.
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
  * 
  **************************************************************************/
 
@@ -49,6 +56,7 @@
 #include <string>
 #include <vector>
 #include <utility>
+#include <cstddef>  // for std::size_t
 
 #include <driver.h>
 

Modified: incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp?view=diff&rev=448928&r1=448927&r2=448928
==============================================================================
--- incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp (original)
+++ incubator/stdcxx/trunk/tests/utilities/20.pairs.cpp Fri Sep 22 06:43:18 2006
@@ -62,7 +62,11 @@
 // instead of qualifying it with its name to work around compiler
 // bugs (e.g., SunPro 5.4 -- see PR #28117)
 
+#ifndef _RWSTD_NO_EMPTY_MEM_INITIALIZER
+
 template pair<DefaultConstructible, DefaultConstructible>::pair ();
+
+#endif  // _RWSTD_NO_EMPTY_MEM_INITIALIZER
 
 template pair<CopyConstructible, CopyConstructible>::
          pair (const CopyConstructible&, const CopyConstructible&);



Mime
View raw message