summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/serialization-source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/tree/serialization-source.cxx')
-rw-r--r--xsd/cxx/tree/serialization-source.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/xsd/cxx/tree/serialization-source.cxx b/xsd/cxx/tree/serialization-source.cxx
index 68d14fa..2f994e7 100644
--- a/xsd/cxx/tree/serialization-source.cxx
+++ b/xsd/cxx/tree/serialization-source.cxx
@@ -1272,14 +1272,13 @@ namespace CXX
if (import_maps || export_maps)
{
- ctx.os << "#ifdef _MSC_VER" << endl
- << endl
- << "namespace xsd"
+ ctx.os << "namespace xsd"
<< "{"
<< "namespace cxx"
<< "{"
<< "namespace tree"
- << "{";
+ << "{"
+ << "#ifdef _MSC_VER" << endl;
if (export_maps)
ctx.os << "template struct __declspec (dllexport) " <<
@@ -1289,11 +1288,14 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"type_serializer_plate< 0, " << ctx.char_type << " >;";
- ctx.os << "}" // tree
- << "}" // cxx
- << "}" // xsd
- << "#endif // _MSC_VER" << endl
- << endl;
+ ctx.os << "#elif defined(__GNUC__) && __GNUC__ >= 4" << endl
+ << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "type_serializer_plate< 0, " << ctx.char_type << " >;";
+
+ ctx.os << "#endif" << endl
+ << "}" // tree
+ << "}" // cxx
+ << "}"; // xsd
}
ctx.os << "namespace _xsd"