// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
+// Some older compilers (such as EMX) cannot handle
+// #pragma interface/implementation correctly, iff
+// #pragma implementation is used in _two_ translation
+// units (as created by e.g. event.cpp compiled for
+// libwx_base and event.cpp compiled for libwx_gui_core).
+// So we must not use those pragmas for those compilers in
+// such files.
#pragma implementation "utils.h"
#endif
#endif // WXWIN_COMPATIBILITY_2_4
-// Id generation
-static long wxCurrentId = 100;
-
-long
-wxNewId (void)
-{
- return wxCurrentId++;
-}
-
-long
-wxGetCurrentId(void) { return wxCurrentId; }
-
-void
-wxRegisterId (long id)
-{
- if (id >= wxCurrentId)
- wxCurrentId = id + 1;
-}
-
// ----------------------------------------------------------------------------
// String <-> Number conversions (deprecated)
// ----------------------------------------------------------------------------
if ( ! traits )
traits = &traitsConsole;
- return traits->GetOSVersion(verMaj, verMin);
+ wxToolkitInfo& info = traits->GetToolkitInfo();
+ if ( verMaj )
+ *verMaj = info.versionMajor;
+ if ( verMin )
+ *verMin = info.versionMinor;
+ return info.os;
}
// ----------------------------------------------------------------------------
static const int maxLoginLen = 256; // FIXME arbitrary number
wxString buf;
- bool ok = wxGetUserId(buf.GetWriteBuf(maxLoginLen), maxLoginLen);
- buf.UngetWriteBuf();
+ bool ok = wxGetUserId(wxStringBuffer(buf, maxLoginLen), maxLoginLen);
if ( !ok )
buf.Empty();
static const int maxUserNameLen = 1024; // FIXME arbitrary number
wxString buf;
- bool ok = wxGetUserName(buf.GetWriteBuf(maxUserNameLen), maxUserNameLen);
- buf.UngetWriteBuf();
+ bool ok = wxGetUserName(wxStringBuffer(buf, maxUserNameLen), maxUserNameLen);
if ( !ok )
buf.Empty();
static const size_t hostnameSize = 257;
wxString buf;
- bool ok = wxGetHostName(buf.GetWriteBuf(hostnameSize), hostnameSize);
-
- buf.UngetWriteBuf();
+ bool ok = wxGetHostName(wxStringBuffer(buf, hostnameSize), hostnameSize);
if ( !ok )
buf.Empty();
static const size_t hostnameSize = 257;
wxString buf;
- bool ok = wxGetFullHostName(buf.GetWriteBuf(hostnameSize), hostnameSize);
-
- buf.UngetWriteBuf();
+ bool ok = wxGetFullHostName(wxStringBuffer(buf, hostnameSize), hostnameSize);
if ( !ok )
buf.Empty();
#if wxUSE_GUI
+// Id generation
+static long wxCurrentId = 100;
+
+long
+wxNewId (void)
+{
+ return wxCurrentId++;
+}
+
+long
+wxGetCurrentId(void) { return wxCurrentId; }
+
+void
+wxRegisterId (long id)
+{
+ if (id >= wxCurrentId)
+ wxCurrentId = id + 1;
+}
+
#if wxUSE_MENUS
// ----------------------------------------------------------------------------