aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/parser/parser-source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/parser/parser-source.cxx')
-rw-r--r--xsd/cxx/parser/parser-source.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/xsd/cxx/parser/parser-source.cxx b/xsd/cxx/parser/parser-source.cxx
index 20e447a..3504a0f 100644
--- a/xsd/cxx/parser/parser-source.cxx
+++ b/xsd/cxx/parser/parser-source.cxx
@@ -827,14 +827,13 @@ namespace CXX
if (import_maps || export_maps)
{
- ctx.os << "#ifdef _MSC_VER" << endl
- << endl
- << "namespace xsd"
+ ctx.os << "namespace xsd"
<< "{"
<< "namespace cxx"
<< "{"
<< "namespace parser"
- << "{";
+ << "{"
+ << "#ifdef _MSC_VER" << endl;
if (export_maps)
ctx.os << "template struct __declspec (dllexport) " <<
@@ -852,11 +851,18 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"inheritance_map_init< " << ctx.char_type << " >;";
- ctx.os << "}" // parser
- << "}" // cxx
- << "}" // xsd
- << "#endif // _MSC_VER" << endl
- << endl;
+ ctx.os << "#elif defined(__GNUC__) && __GNUC__ >= 4" << endl
+ << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "substitution_map_init< " << ctx.char_type << " >;";
+
+ if (ctx.validation)
+ ctx.os << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "inheritance_map_init< " << ctx.char_type << " >;";
+
+ ctx.os << "#endif" << endl
+ << "}" // parser
+ << "}" // cxx
+ << "}"; // xsd
}
ctx.os << "static" << endl