From: Vadim Zeitlin Date: Fri, 26 Nov 1999 11:37:42 +0000 (+0000) Subject: 1. wxBase compiles/links again X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/252a752e85d42d81f2c55e128ab3bd9c6fd70c51 1. wxBase compiles/links again 2. wxString::reserve() (STLese for Alloc()) added 3. compilation fixes for mingw32/BC++ git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/app.h b/include/wx/app.h index 2ce1cad8bf..51d126b8ea 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -302,8 +302,6 @@ WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; // event loop related functions only work in GUI programs // ------------------------------------------------------ -#if wxUSE_GUI - // Force an exit from main loop extern void WXDLLEXPORT wxExit(); @@ -313,6 +311,8 @@ extern bool WXDLLEXPORT wxYield(); // Yield to other apps/messages extern void WXDLLEXPORT wxWakeUpIdle(); +#if wxUSE_GUI + // Post a message to the given eventhandler which will be processed during the // next event loop iteration inline void WXDLLEXPORT wxPostEvent(wxEvtHandler *dest, wxEvent& event) @@ -322,7 +322,7 @@ inline void WXDLLEXPORT wxPostEvent(wxEvtHandler *dest, wxEvent& event) dest->AddPendingEvent(event); } -#endif // wxUSE_GUI +#endif // wxUSE_GUI/!wxUSE_GUI // console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros // and call these functions instead at the program startup and termination diff --git a/include/wx/string.h b/include/wx/string.h index cf7a45ac25..29be6c6770 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -705,6 +705,8 @@ public: void clear() { Empty(); } // returns true if the string is empty bool empty() const { return IsEmpty(); } + // inform string about planned change in size + void reserve(size_t size) { Alloc(size); } // lib.string.access // return the character at position n diff --git a/src/common/init.cpp b/src/common/init.cpp index 8925cb193f..846026eb93 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -60,6 +60,32 @@ static size_t gs_nInitCount = 0; // implementation // ============================================================================ +// ---------------------------------------------------------------------------- +// stubs for some GUI functions +// ---------------------------------------------------------------------------- + +void WXDLLEXPORT wxExit() +{ + abort(); +} + +// Yield to other apps/messages +bool WXDLLEXPORT wxYield() +{ + // do nothing + return TRUE; +} + +// Yield to other apps/messages +void WXDLLEXPORT wxWakeUpIdle() +{ + // do nothing +} + +// ---------------------------------------------------------------------------- +// wxBase-specific functions +// ---------------------------------------------------------------------------- + bool WXDLLEXPORT wxInitialize() { if ( gs_nInitCount )