From 2c0a77a8f4565b6ef76c32b970df48369b3d0456 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Feb 2010 14:44:30 +0200 Subject: Add support for excluding export code from compilation Affected options: --generate-xml-schema, --export-maps, --import-maps. New macros: XSD_NO_EXPORT, XSD_MAP_VISIBILITY. Reorder template arguments for the idref type. --- xsd/cxx/tree/tree-source.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'xsd/cxx/tree/tree-source.cxx') diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx index 3f902e7..ef5ad8e 100644 --- a/xsd/cxx/tree/tree-source.cxx +++ b/xsd/cxx/tree/tree-source.cxx @@ -3370,7 +3370,9 @@ namespace CXX if (import_maps || export_maps) { - ctx.os << "namespace xsd" + ctx.os << "#ifndef XSD_NO_EXPORT" << endl + << endl + << "namespace xsd" << "{" << "namespace cxx" << "{" @@ -3404,10 +3406,22 @@ namespace CXX ctx.os << "template struct __attribute__ ((visibility(\"default\"))) " << "comparison_plate< 0, " << ctx.char_type << " >;"; + ctx.os << "#elif defined(XSD_MAP_VISIBILITY)" << endl; + + if (parsing) + ctx.os << "template struct XSD_MAP_VISIBILITY " << + "type_factory_plate< 0, " << ctx.char_type << " >;"; + + if (comparison) + ctx.os << "template struct XSD_MAP_VISIBILITY " << + "comparison_plate< 0, " << ctx.char_type << " >;"; + ctx.os << "#endif" << endl << "}" // tree << "}" // cxx - << "}"; // xsd + << "}" // xsd + << "#endif // XSD_NO_EXPORT" << endl + << endl; } ctx.os << "namespace _xsd" -- cgit v1.1