aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/stream-extraction-source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-12-10 14:38:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-12-10 14:38:36 +0200
commit229ba91523794b85ce4a4883a975f63c80252b77 (patch)
tree25533cb2869ec992fa8a7dce07a28f0d6fba1011 /xsd/cxx/tree/stream-extraction-source.cxx
parent1ca6396a3dd284241de11bcaa210ad5836e8e5a8 (diff)
Export type maps in GCC 4.x using the visibility attribute
Diffstat (limited to 'xsd/cxx/tree/stream-extraction-source.cxx')
-rw-r--r--xsd/cxx/tree/stream-extraction-source.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/xsd/cxx/tree/stream-extraction-source.cxx b/xsd/cxx/tree/stream-extraction-source.cxx
index 14920e0..97034a8 100644
--- a/xsd/cxx/tree/stream-extraction-source.cxx
+++ b/xsd/cxx/tree/stream-extraction-source.cxx
@@ -679,9 +679,7 @@ namespace CXX
if (import_maps || export_maps)
{
- ctx.os << "#ifdef _MSC_VER" << endl
- << endl
- << "namespace xsd"
+ ctx.os << "namespace xsd"
<< "{"
<< "namespace cxx"
<< "{"
@@ -692,6 +690,8 @@ namespace CXX
{
String stream (*i);
+ ctx.os << "#ifdef _MSC_VER" << endl;
+
if (export_maps)
ctx.os << "template struct __declspec (dllexport) " <<
"stream_extraction_plate< 0, " << stream << ", " <<
@@ -701,13 +701,17 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"stream_extraction_plate< 0, " << stream << ", " <<
ctx.char_type << " >;";
+
+ ctx.os << "#elif defined(__GNUC__) && __GNUC__ >= 4" << endl
+ << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "stream_extraction_plate< 0, " << stream << ", " <<
+ ctx.char_type << " >;"
+ << "#endif" << endl;
}
- ctx.os << "}" // tree
- << "}" // cxx
- << "}" // xsd
- << "#endif // _MSC_VER" << endl
- << endl;
+ ctx.os << "}" // tree
+ << "}" // cxx
+ << "}"; // xsd
}
ctx.os << "namespace _xsd"