From 9c56ae5fe8559b0830bdbad932da35cf4363f901 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Apr 2004 23:32:31 +0000 Subject: [PATCH] implemented abort() and added stub for getenv(): needed to link with libjpeg/libpng git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/wince/crt.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/msw/wince/crt.cpp b/src/msw/wince/crt.cpp index 058e7b260a..50804e856b 100644 --- a/src/msw/wince/crt.cpp +++ b/src/msw/wince/crt.cpp @@ -9,14 +9,18 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#include "wx/msw/wince/missing.h" - #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + +#include "wx/msw/wince/missing.h" + extern "C" void * bsearch(const void *key, const void *base, size_t num, size_t size, int (wxCMPFUNC_CONV *cmp)(const void *, const void *)) @@ -42,4 +46,26 @@ bsearch(const void *key, const void *base, size_t num, size_t size, return NULL; } +extern "C" +void abort() +{ + wxString name; + if ( wxTheApp ) + name = wxTheApp->GetAppName(); + if ( name.empty() ) + name = L"wxWindows Application"; + + MessageBox(NULL, L"Abnormal program termination", name, MB_ICONHAND | MB_OK); + + ::ExitProcess(3); +} + +extern "C" +char *getenv(const char * WXUNUSED(name)) +{ + // no way to implement it in Unicode-only environment without using + // wxCharBuffer and it is of no use in C code which uses this function + // (libjpeg) + return NULL; +}