You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/05/13 00:40:28 UTC
svn commit: r405913 - /incubator/stdcxx/trunk/src/instance.cpp
Author: sebor
Date: Fri May 12 15:40:27 2006
New Revision: 405913
URL: http://svn.apache.org/viewcvs?rev=405913&view=rev
Log:
2006-05-12 Martin Sebor <se...@roguewave.com>
* instance.cpp (__nullref): Increased the size of the array to make
big enough to accommodate std::wstring times two with some extra
space to spare.
Modified:
incubator/stdcxx/trunk/src/instance.cpp
Modified: incubator/stdcxx/trunk/src/instance.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/src/instance.cpp?rev=405913&r1=405912&r2=405913&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/instance.cpp (original)
+++ incubator/stdcxx/trunk/src/instance.cpp Fri May 12 15:40:27 2006
@@ -2,20 +2,26 @@
*
* instance.cpp - Instantiations of the C++ Standard Library templates.
*
- * $Id: //stdlib/dev/source/stdlib/instance.cpp#50 $
+ * $Id$
*
***************************************************************************
*
- * 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.
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * 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
+ *
+ * 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.
*
**************************************************************************/
@@ -32,11 +38,26 @@
_RWSTD_NAMESPACE (__rw) {
-typedef __string_ref<char, _STD::char_traits<char>, _STD::allocator<char> >
- StringRef;
+#ifndef _RWSTD_NO_WCHAR_T
+
+typedef _STD::char_traits<wchar_t> Traits;
+typedef _STD::allocator<wchar_t> Allocator;
+
+typedef __string_ref<wchar_t, Traits, Allocator> StringRef;
+
+#else // if defined (_RWSTD_NO_WCHAR_T)
+
+typedef _STD::char_traits<char> Traits;
+typedef _STD::allocator<char> Allocator;
+
+typedef __string_ref<char, Traits, Allocator> StringRef;
+
+#endif // _RWSTD_NO_WCHAR_T
-// this is wrong -- it won't work at all for other (non-char) specializations
-_RWSTD_EXPORT unsigned long __nullref [sizeof (StringRef) / 4 + 2];
+// FIXME: this won't work at all for other (non-char) specializations
+// try to allocate enough space for std::wstring plus some overhead
+_RWSTD_EXPORT unsigned long
+__nullref [4 * sizeof (StringRef) / sizeof (long) + 2];
} // namespace __rw