aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-05-30 19:15:16 -0400
committerBoris Kolpackov <boris@codesynthesis.com>2013-05-30 19:15:16 -0400
commit0f55f6e93d8c7879f3cef863b9d79c3733409ddf (patch)
tree125719b52998e9c71a4c6a261ec6878092b5c3df
parentf2723d0d78b532a9847d3448237d0ce3f789d2e7 (diff)
GCC 2.9X cannot do enum-to-enum static_cast
-rw-r--r--xsde/cxx/hybrid/parser-source.cxx5
-rw-r--r--xsde/cxx/hybrid/serializer-source.cxx26
2 files changed, 23 insertions, 8 deletions
diff --git a/xsde/cxx/hybrid/parser-source.cxx b/xsde/cxx/hybrid/parser-source.cxx
index a5df5bc..1f31d2a 100644
--- a/xsde/cxx/hybrid/parser-source.cxx
+++ b/xsde/cxx/hybrid/parser-source.cxx
@@ -1257,13 +1257,16 @@ namespace CXX
os << access;
}
+ // GCC 2.9X cannot do enum-to-enum static_cast.
+ //
os << earm (c) << " (" << endl
<< "static_cast< " << type_scope;
if (c.context ().count ("type"))
os << "::" << etype (c);
- os << "::" << earm_tag (c) << " > (t));"
+ os << "::" << earm_tag (c) << " > (" << endl
+ << "static_cast< unsigned int > (t)));"
<< endl;
// Test whether we have any arms that need initialization.
diff --git a/xsde/cxx/hybrid/serializer-source.cxx b/xsde/cxx/hybrid/serializer-source.cxx
index d93ffa4..7834aae 100644
--- a/xsde/cxx/hybrid/serializer-source.cxx
+++ b/xsde/cxx/hybrid/serializer-source.cxx
@@ -747,8 +747,12 @@ namespace CXX
os << esskel (t) << "::" << arm_tag << " " << s << "::" << endl
<< esarm (c) << " ()"
<< "{"
- << arm_tag << " t (static_cast< " << arm_tag << " > (" << endl
- << access << iter << "->" << earm (c) << " ()));";
+ // GCC 2.9X cannot do enum-to-enum static_cast.
+ //
+ << arm_tag << " t (" << endl
+ << "static_cast< " << arm_tag << " > (" << endl
+ << "static_cast< unsigned int > (" << endl
+ << access << iter << "->" << earm (c) << " ())));";
}
else if (c.min () == 0)
{
@@ -761,24 +765,32 @@ namespace CXX
os << esskel (t) << "::" << arm_tag << " " << s << "::" << endl
<< esarm (c) << " ()"
<< "{"
- << arm_tag << " t (static_cast< " << arm_tag << " > (" << endl
- << access << ename (c) << " ()." << earm (c) << " ()));";
+ // GCC 2.9X cannot do enum-to-enum static_cast.
+ //
+ << arm_tag << " t (" << endl
+ << "static_cast< " << arm_tag << " > (" << endl
+ << "static_cast< unsigned int > (" << endl
+ << access << ename (c) << " ()." << earm (c) << " ())));";
}
else
{
os << esskel (t) << "::" << arm_tag << " " << s << "::" << endl
<< esarm (c) << " ()"
<< "{"
- << arm_tag << " t (static_cast< " << arm_tag << " > (" << endl;
+ // GCC 2.9X cannot do enum-to-enum static_cast.
+ //
+ << arm_tag << " t (" << endl
+ << "static_cast< " << arm_tag << " > (" << endl
+ << "static_cast< unsigned int > (" << endl;
// We may be in a choice in which case we get a nested
// type (and accessor function) even for min == max == 1.
//
if (c.context ().count ("type"))
- os << access << ename (c) << " ()." << earm (c) << " ()));";
+ os << access << ename (c) << " ()." << earm (c) << " ())));";
else
- os << access << earm (c) << " ()));";
+ os << access << earm (c) << " ())));";
}
// Test whether we have any arms that need initialization.