summaryrefslogtreecommitdiff
path: root/xsd/libxsd/xsd/cxx/xml/string.txx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/libxsd/xsd/cxx/xml/string.txx')
-rw-r--r--xsd/libxsd/xsd/cxx/xml/string.txx19
1 files changed, 15 insertions, 4 deletions
diff --git a/xsd/libxsd/xsd/cxx/xml/string.txx b/xsd/libxsd/xsd/cxx/xml/string.txx
index df0fb74..e6adb98 100644
--- a/xsd/libxsd/xsd/cxx/xml/string.txx
+++ b/xsd/libxsd/xsd/cxx/xml/string.txx
@@ -1,6 +1,5 @@
// file : xsd/cxx/xml/string.txx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSD_CXX_XML_STRING_TXX
@@ -47,7 +46,13 @@ namespace xsd
XMLCh* wchar_transcoder<W, 2>::
from (const W* s, std::size_t length)
{
- auto_array<XMLCh> r (new XMLCh[length + 1]);
+#ifdef XSD_CXX11
+ std::unique_ptr<XMLCh[]> r (
+#else
+ auto_array<XMLCh> r (
+#endif
+ new XMLCh[length + 1]);
+
XMLCh* ir (r.get ());
for (std::size_t i (0); i < length; ++ir, ++i)
@@ -120,7 +125,13 @@ namespace xsd
rl += (*p & 0xFFFF0000) ? 2 : 1;
}
- auto_array<XMLCh> r (new XMLCh[rl + 1]);
+#ifdef XSD_CXX11
+ std::unique_ptr<XMLCh[]> r (
+#else
+ auto_array<XMLCh> r (
+#endif
+ new XMLCh[rl + 1]);
+
XMLCh* ir (r.get ());
for (const W* p (s); p < s + length; ++p)