From 5260b1c582632afeb8f25db7f10697c8d45461b4 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 2 Jul 1998 15:16:56 +0000 Subject: [PATCH] Various changes for 16-bit compilation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/config.cpp | 1 + src/common/datstrm.cpp | 9 ++++++--- src/common/log.cpp | 9 ++++++++- src/common/memory.cpp | 4 ++++ src/generic/gridg.cpp | 2 +- src/msw/makefile.b32 | 1 - src/msw/makefile.dos | 10 ++++++++-- src/msw/makefile.nt | 2 +- src/msw/ole/dataobj.cpp | 7 +++++++ src/msw/ownerdrw.cpp | 8 ++++---- src/msw/scrolbar.cpp | 2 +- src/msw/utilsexc.cpp | 8 ++++++++ 12 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 9eae6aafa1..96f6a9c197 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include // for isalnum() diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index 048b3c50dc..980a280c13 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -87,10 +87,11 @@ unsigned char wxDataStream::Read8() return (unsigned char)buf; } +// Must be at global scope for VC++ 5 +extern "C" double ConvertFromIeeeExtended(const unsigned char *bytes); + double wxDataStream::ReadDouble() { - extern "C" double ConvertFromIeeeExtended(const unsigned char *bytes); - #if USE_APPLE_IEEE char buf[10]; @@ -159,9 +160,11 @@ void wxDataStream::WriteLine(const wxString& line) m_ostream->write((const char *) tmp_string, tmp_string.Length()); } +// Must be at global scope for VC++ 5 +extern "C" void ConvertToIeeeExtended(double num, unsigned char *bytes); + void wxDataStream::WriteDouble(double d) { - extern "C" void ConvertToIeeeExtended(double num, unsigned char *bytes) char buf[10]; if (!m_ostream) diff --git a/src/common/log.cpp b/src/common/log.cpp index 5c4b30f179..dd32729b41 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -496,6 +496,7 @@ public: // menu callbacks void OnClose(wxCommandEvent& event); + void OnCloseWindow(wxCloseEvent& event); void OnSave (wxCommandEvent& event); void OnClear(wxCommandEvent& event); @@ -521,7 +522,7 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) EVT_MENU(Menu_Save, wxLogFrame::OnSave) EVT_MENU(Menu_Clear, wxLogFrame::OnClear) - EVT_CLOSE(wxLogFrame::OnClose) + EVT_CLOSE(wxLogFrame::OnCloseWindow) END_EVENT_TABLE() wxLogFrame::wxLogFrame(const char *szTitle) @@ -563,6 +564,12 @@ void wxLogFrame::OnClose(wxCommandEvent& event) Show(FALSE); } +void wxLogFrame::OnCloseWindow(wxCloseEvent& event) +{ + // just hide the window + Show(FALSE); +} + void wxLogFrame::OnSave(wxCommandEvent& event) { // get the file name diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 28256329b4..fee8108d50 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -884,6 +884,7 @@ void * operator new (size_t size, char * fileName, int lineNum) #endif } +#if !( defined (_MSC_VER) && (_MSC_VER <= 800) ) void * operator new[] (size_t size, char * fileName, int lineNum) { #ifdef NO_DEBUG_ALLOCATION @@ -892,6 +893,7 @@ void * operator new[] (size_t size, char * fileName, int lineNum) return wxDebugAlloc(size, fileName, lineNum, FALSE, TRUE); #endif } +#endif void operator delete (void * buf) { @@ -902,6 +904,7 @@ void operator delete (void * buf) #endif } +#if !( defined (_MSC_VER) && (_MSC_VER <= 800) ) void operator delete[] (void * buf) { #ifdef NO_DEBUG_ALLOCATION @@ -910,6 +913,7 @@ void operator delete[] (void * buf) wxDebugFree(buf, TRUE); #endif } +#endif #endif diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index 1526c19318..cb34fb1325 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -436,7 +436,7 @@ void wxGenericGrid::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC paintDC(this); wxMemoryDC dc(& paintDC); - dc.SelectObject(m_doubleBufferingBitmap); + dc.SelectObject(* m_doubleBufferingBitmap); PaintGrid(dc); diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index 623cd3687f..7bfc10906a 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -140,7 +140,6 @@ MSWOBJS = \ $(MSWDIR)\font.obj \ $(MSWDIR)\fontdlg.obj \ $(MSWDIR)\frame.obj \ - $(MSWDIR)\gauge.obj \ $(MSWDIR)\gauge95.obj \ $(MSWDIR)\gaugemsw.obj \ $(MSWDIR)\gdiobj.obj \ diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index f49efaa1a7..4f06021518 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -151,7 +151,7 @@ MSWOBJS = \ $(MSWDIR)\listctrl.obj \ $(MSWDIR)\main.obj \ $(MSWDIR)\mdi.obj \ - $(MSWDIR)\menu.obj \ + $(MSWDIR)\menu.obj\ $(MSWDIR)\menuitem.obj \ $(MSWDIR)\metafile.obj \ $(MSWDIR)\minifram.obj \ @@ -178,6 +178,7 @@ MSWOBJS = \ $(MSWDIR)\timer.obj \ $(MSWDIR)\treectrl.obj \ $(MSWDIR)\utils.obj \ + $(MSWDIR)\utilsexc.obj \ $(MSWDIR)\wave.obj \ $(MSWDIR)\window.obj \ $(OLEDIR)\droptgt.obj \ @@ -585,6 +586,11 @@ $(MSWDIR)/utils.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(MSWDIR)/utilsexc.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(MSWDIR)/wave.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -815,7 +821,7 @@ $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) $(COMMDIR)/extended.obj: $*.c cl @<< -$(CPPFLAGS) /Fo$@ /c /Tp $*.c +$(CPPFLAGS2) /Fo$@ /c /Tp $*.c << $(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt index 015e7e48b6..9e92f8eaa3 100644 --- a/src/msw/makefile.nt +++ b/src/msw/makefile.nt @@ -894,7 +894,7 @@ $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ $(COMMDIR)/extended.obj: $*.c cl @<< -$(CPPFLAGS) /c /Tp $*.c /Fo$@ +$(CPPFLAGS2) /c /Tp $*.c /Fo$@ << $(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 708fc1767b..941748b092 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -28,6 +28,10 @@ #pragma hdrstop #endif +#include + +#ifdef __WIN32__ + #include #include #include @@ -400,3 +404,6 @@ static const char *GetTymedName(DWORD tymed) return s_szBuf; } } + +#endif + diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 22c152f23d..87e3ba77b6 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -162,7 +162,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt if ( IsCheckable() && !m_bmpChecked.Ok() ) { if ( st & wxODChecked ) { // using native APIs for performance and simplicity - #ifdef O_DRAW_NATIVE_API +#ifdef O_DRAW_NATIVE_API // what goes on: DrawFrameControl creates a b/w mask, // then we copy it to screen to have right colors @@ -179,10 +179,10 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight, hdcMem, 0, 0, SRCCOPY); DeleteDC(hdcMem); - #else +#else // #### to do: perhaps using Marlett font (create equiv. font under X) - wxFAIL("not implemented"); - #endif //O_DRAW_NATIVE_API +// wxFAIL("not implemented"); +#endif //O_DRAW_NATIVE_API } } else { diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 3514ea2245..d934d96d8a 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -100,7 +100,7 @@ bool wxScrollBar::Create(wxWindow *parent, const wxWindowID id, ::SetScrollPos(scroll_bar, SB_CTL, 0, FALSE); ShowWindow(scroll_bar, SW_SHOW); - SetFont(parent->GetFont()); + SetFont(* parent->GetFont()); m_hWnd = (WXHWND)scroll_bar; diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index ac3c249d08..ef2e39750b 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -63,6 +63,10 @@ #endif #include +IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent) +IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler) + + #define wxEXECUTE_WIN_MESSAGE 10000 struct wxExecuteData { @@ -72,6 +76,8 @@ struct wxExecuteData { char state; }; + +#ifdef __WIN32__ static DWORD wxExecuteThread(wxExecuteData *data) { WaitForSingleObject(data->process, INFINITE); @@ -81,6 +87,8 @@ static DWORD wxExecuteThread(wxExecuteData *data) return 0; } +#endif + LRESULT APIENTRY _EXPORT wxExecuteWindowCbk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -- 2.47.2