summaryrefslogtreecommitdiff
path: root/xsd/cxx/parser/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-01-19 10:05:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-01-19 10:06:32 +0200
commit0fdf19714613a82a184f4f6e75fb9a4f9b62f18a (patch)
tree93bb2df0f9d9eab44d36dedf29d4df500ecefcbc /xsd/cxx/parser/generator.cxx
parent45db924dfc19b49b7930522dbddd123fb9575e32 (diff)
Use std::unique_ptr instead of std::auto_ptr in C++11 mode
Diffstat (limited to 'xsd/cxx/parser/generator.cxx')
-rw-r--r--xsd/cxx/parser/generator.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/xsd/cxx/parser/generator.cxx b/xsd/cxx/parser/generator.cxx
index a262004..46a0687 100644
--- a/xsd/cxx/parser/generator.cxx
+++ b/xsd/cxx/parser/generator.cxx
@@ -290,12 +290,14 @@ namespace CXX
string_type = L"::std::basic_string< " + char_type + L" >";
String xns;
+ String auto_ptr;
{
Context ctx (std::wcerr, schema, file_path, ops, 0, 0, 0, 0);
xns = ctx.xs_ns_name ();
+ auto_ptr = ctx.auto_ptr;
}
- String buffer (L"::std::auto_ptr< " + xns + L"::buffer >");
+ String buffer (auto_ptr + L"< " + xns + L"::buffer >");
TypeMap::Namespace xsd ("http://www\\.w3\\.org/2001/XMLSchema");
xsd.types_push_back ("string", string_type);
@@ -777,6 +779,14 @@ namespace CXX
<< "#define " << guard << endl
<< endl;
+ if (ctx.std >= cxx_version::cxx11)
+ {
+ hxx << "#ifndef XSD_CXX11" << endl
+ << "#define XSD_CXX11" << endl
+ << "#endif" << endl
+ << endl;
+ }
+
// Version check.
//
hxx << "#include <xsd/cxx/config.hxx>" << endl