+void *wxULongLongNative::asArray() const
+{
+ static unsigned char temp[8];
+
+ temp[0] = wx_truncate_cast(unsigned char, ((m_ll >> 56) & 0xFF));
+ temp[1] = wx_truncate_cast(unsigned char, ((m_ll >> 48) & 0xFF));
+ temp[2] = wx_truncate_cast(unsigned char, ((m_ll >> 40) & 0xFF));
+ temp[3] = wx_truncate_cast(unsigned char, ((m_ll >> 32) & 0xFF));
+ temp[4] = wx_truncate_cast(unsigned char, ((m_ll >> 24) & 0xFF));
+ temp[5] = wx_truncate_cast(unsigned char, ((m_ll >> 16) & 0xFF));
+ temp[6] = wx_truncate_cast(unsigned char, ((m_ll >> 8) & 0xFF));
+ temp[7] = wx_truncate_cast(unsigned char, ((m_ll >> 0) & 0xFF));
+
+ return temp;
+}
+
+#if wxUSE_LONGLONG_WX
+wxLongLongNative::wxLongLongNative(wxLongLongWx ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ll.GetLo();
+}
+
+wxLongLongNative& wxLongLongNative::operator=(wxLongLongWx ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ll.GetLo();
+ return *this;
+}
+
+wxLongLongNative& wxLongLongNative::operator=(const class wxULongLongWx &ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ll.GetLo();
+ return *this;
+}
+
+wxULongLongNative::wxULongLongNative(const class wxULongLongWx &ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ((unsigned long) ll.GetLo());
+}
+
+wxULongLongNative& wxULongLongNative::operator=(wxLongLongWx ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ((unsigned long) ll.GetLo());
+ return *this;
+}
+
+wxULongLongNative& wxULongLongNative::operator=(const class wxULongLongWx &ll)
+{
+ // assign first to avoid precision loss!
+ m_ll = ll.GetHi();
+ m_ll <<= 32;
+ m_ll |= ((unsigned long) ll.GetLo());
+ return *this;
+}
+#endif
+
+#ifdef __VISUALC6__
+double wxULongLongNative::ToDouble() const
+{
+ // Work around the problem of casting unsigned __int64 to double in VC6
+ // (which for unknown reasons only manifests itself in DLL builds, i.e.
+ // when using /MD).
+ static const __int64 int64_t_max = 9223372036854775807i64;
+ if ( m_ll <= int64_t_max )
+ return wx_truncate_cast(double, (wxLongLong_t)m_ll);
+
+ double d = wx_truncate_cast(double, int64_t_max);
+ d += (__int64)(m_ll - int64_t_max - 1); // The cast is safe because of -1
+ return d + 1;
+}
+#endif // __VISUALC6__
+