+
+#ifndef WX_PRECOMP
+ #include "wx/math.h"
+#endif //WX_PRECOMP
+
+namespace
+{
+
+// helper unions used to swap bytes of floats and doubles
+union Float32Data
+{
+ wxFloat32 f;
+ wxUint32 i;
+};
+
+union Float64Data
+{
+ wxFloat64 f;
+ wxUint32 i[2];
+};
+
+} // anonymous namespace
+
+// ----------------------------------------------------------------------------
+// wxDataStreamBase
+// ----------------------------------------------------------------------------
+
+wxDataStreamBase::wxDataStreamBase(const wxMBConv& conv)
+#if wxUSE_UNICODE
+ : m_conv(conv.Clone())
+#endif // wxUSE_UNICODE
+{
+ // It is unused in non-Unicode build, so suppress a warning there.
+ wxUnusedVar(conv);
+
+ m_be_order = false;
+
+ // For compatibility with the existing data files, we use extended
+ // precision if it is available, i.e. if wxUSE_APPLE_IEEE is on.
+#if wxUSE_APPLE_IEEE
+ m_useExtendedPrecision = true;
+#endif // wxUSE_APPLE_IEEE
+}
+
+#if wxUSE_UNICODE
+void wxDataStreamBase::SetConv( const wxMBConv &conv )
+{
+ delete m_conv;
+ m_conv = conv.Clone();
+}
+#endif
+
+wxDataStreamBase::~wxDataStreamBase()
+{
+#if wxUSE_UNICODE
+ delete m_conv;
+#endif // wxUSE_UNICODE
+}