summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/tree')
-rw-r--r--xsd/cxx/tree/serialization-source.cxx20
-rw-r--r--xsd/cxx/tree/stream-extraction-source.cxx20
-rw-r--r--xsd/cxx/tree/stream-insertion-source.cxx20
-rw-r--r--xsd/cxx/tree/stream-source.cxx20
-rw-r--r--xsd/cxx/tree/tree-source.cxx26
5 files changed, 63 insertions, 43 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"
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"
diff --git a/xsd/cxx/tree/stream-insertion-source.cxx b/xsd/cxx/tree/stream-insertion-source.cxx
index 867f0ed..9cd3e29 100644
--- a/xsd/cxx/tree/stream-insertion-source.cxx
+++ b/xsd/cxx/tree/stream-insertion-source.cxx
@@ -458,9 +458,7 @@ namespace CXX
if (import_maps || export_maps)
{
- ctx.os << "#ifdef _MSC_VER" << endl
- << endl
- << "namespace xsd"
+ ctx.os << "namespace xsd"
<< "{"
<< "namespace cxx"
<< "{"
@@ -471,6 +469,8 @@ namespace CXX
{
String stream (*i);
+ ctx.os << "#ifdef _MSC_VER" << endl;
+
if (export_maps)
ctx.os << "template struct __declspec (dllexport) " <<
"stream_insertion_plate< 0, " << stream << ", " <<
@@ -480,13 +480,17 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"stream_insertion_plate< 0, " << stream << ", " <<
ctx.char_type << " >;";
+
+ ctx.os << "#elif defined(__GNUC__) && __GNUC__ >= 4" << endl
+ << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "stream_insertion_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"
diff --git a/xsd/cxx/tree/stream-source.cxx b/xsd/cxx/tree/stream-source.cxx
index 57115a0..2888009 100644
--- a/xsd/cxx/tree/stream-source.cxx
+++ b/xsd/cxx/tree/stream-source.cxx
@@ -430,14 +430,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) " <<
@@ -447,11 +446,14 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"std_ostream_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\"))) " <<
+ "std_ostream_plate< 0, " << ctx.char_type << " >;";
+
+ ctx.os << "#endif" << endl
+ << "}" // tree
+ << "}" // cxx
+ << "}"; // xsd
}
ctx.os << "namespace _xsd"
diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx
index fa9046f..48702a1 100644
--- a/xsd/cxx/tree/tree-source.cxx
+++ b/xsd/cxx/tree/tree-source.cxx
@@ -3376,14 +3376,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 (parsing && export_maps)
ctx.os << "template struct __declspec (dllexport) " <<
@@ -3401,11 +3400,20 @@ namespace CXX
ctx.os << "template struct __declspec (dllimport) " <<
"comparison_plate< 0, " << ctx.char_type << " >;";
- ctx.os << "}" // tree
- << "}" // cxx
- << "}" // xsd
- << "#endif // _MSC_VER" << endl
- << endl;
+ ctx.os << "#elif defined(__GNUC__) && __GNUC__ >= 4" << endl;
+
+ if (parsing)
+ ctx.os << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "type_factory_plate< 0, " << ctx.char_type << " >;";
+
+ if (comparison)
+ ctx.os << "template struct __attribute__ ((visibility(\"default\"))) " <<
+ "comparison_plate< 0, " << ctx.char_type << " >;";
+
+ ctx.os << "#endif" << endl
+ << "}" // tree
+ << "}" // cxx
+ << "}"; // xsd
}
ctx.os << "namespace _xsd"