+void wxPlatformInfo::InitForCurrentPlatform()
+{
+ // autodetect all informations
+ const wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+ if ( !traits )
+ {
+ wxFAIL_MSG( _T("failed to initialize wxPlatformInfo") );
+
+ m_port = wxPORT_UNKNOWN;
+ m_usingUniversal = false;
+ m_tkVersionMajor =
+ m_tkVersionMinor = 0;
+ }
+ else
+ {
+ m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor);
+ m_usingUniversal = traits->IsUsingUniversalWidgets();
+ }
+
+ m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor);
+ m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG;
+ m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32;
+}
+
+/* static */
+const wxPlatformInfo& wxPlatformInfo::Get()
+{
+ static bool initialized = false;
+ if ( !initialized )
+ {
+ gs_platInfo.InitForCurrentPlatform();
+ initialized = true;
+ }
+
+ return gs_platInfo;
+}
+
+
+