From: Chris Elliott Date: Sat, 19 Apr 2003 18:15:17 +0000 (+0000) Subject: update to make digitalmars compile X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4ce1efe123a9b5f7dbb5be4aaf3dd0a21b399f38 update to make digitalmars compile git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/tmake/sc.t b/distrib/msw/tmake/sc.t index 9ac3bf7c9d..b3a6730f1a 100644 --- a/distrib/msw/tmake/sc.t +++ b/distrib/msw/tmake/sc.t @@ -37,7 +37,7 @@ #! these files don't compile with SC++ 6 next if $file =~ /^(joystick|pnghand)\./; - next if $wxGeneric{$file} =~ /\b16\b/; + next if $wxMSW{$file} =~ /\b16\b/; my $isOleObj = $wxMSW{$file} =~ /\bO\b/; $file =~ s/cp?p?$/obj/; @@ -61,7 +61,7 @@ include ..\makesc.env DEBUG=0 -LIBTARGET = $(LIBDIR)\wx.lib +LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib OPTIONS= @@ -83,26 +83,35 @@ MSWOBJS = #$ ExpandList("WXMSWOBJS"); # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc. OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) -all: $(LIBTARGET) +all: MAKEARCHDIR $(LIBTARGET) + +MAKEARCHDIR: + @if not exist $(MSWINCDIR)\setup.h copy $(MSWINCDIR)\setup0.h $(MSWINCDIR)\setup.h + @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR) + @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)\wx + @if not exist $(ARCHINCDIR)\wx\setup.h copy $(MSWINCDIR)\setup.h $(ARCHINCDIR)\wx\setup.h $(LIBTARGET): $(OBJECTS) -del $(LIBTARGET) *lib /PAGESIZE:512 $(LIBTARGET) y $(OBJECTS), nul; clean: + -del $(COMMDIR)\*.obj + -del $(MSWDIR)\*.obj + -del $(GENDIR)\*.obj -del *.obj -del $(LIBTARGET) -$(COMMDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c - -$(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c - copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c - -$(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c - copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c - -# $(COMMDIR)\cmndata.obj: $(COMMDIR)\cmndata.cpp -# *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj +## $(COMMDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c +## +## $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c +## copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c +## +## $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c +## copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c +## +### $(COMMDIR)\cmndata.obj: $(COMMDIR)\cmndata.cpp +### *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj MFTYPE=sc makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t diff --git a/include/wx/defs.h b/include/wx/defs.h index c6c3699a6b..25cb52771a 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -157,6 +157,9 @@ #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) // Watcom 11+ supports bool #define HAVE_BOOL + #elif defined(__DIGITALMARS__) + // DigitalMars supports bool + #define HAVE_BOOL #elif defined(__GNUWIN32__) || defined(__MINGW32__) || defined(__CYGWIN__) // Cygwin supports bool #define HAVE_BOOL diff --git a/include/wx/filename.h b/include/wx/filename.h index 647e231e94..e8a87042b8 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -394,9 +394,10 @@ public: // deprecated methods, don't use any more // -------------------------------------- +#ifndef __DIGITALMARS__ wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const { return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); } - +#endif wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const { return GetPath(wxPATH_GET_SEPARATOR, format); } diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 75efef8d65..d087120311 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -50,7 +50,9 @@ public: wxBitmap(const char bits[], int width, int height, int depth = 1); // Initialize with XPM data +#ifndef __DIGITALMARS__ wxBitmap(const char **data) { CreateFromXpm(data); } +#endif wxBitmap(char **data) { CreateFromXpm((const char **)data); } // Load a file or resource diff --git a/include/wx/msw/icon.h b/include/wx/msw/icon.h index 741874298c..4583310223 100644 --- a/include/wx/msw/icon.h +++ b/include/wx/msw/icon.h @@ -54,7 +54,9 @@ public: // from raw data wxIcon(const char bits[], int width, int height); // from XPM data +#ifndef __DIGITALMARS__ wxIcon(const char **data) { CreateIconFromXpm(data); } +#endif wxIcon(char **data) { CreateIconFromXpm((const char **)data); } // from resource/file wxIcon(const wxString& name, diff --git a/include/wx/msw/missing.h b/include/wx/msw/missing.h index 62c8c2a762..3ce2627674 100644 --- a/include/wx/msw/missing.h +++ b/include/wx/msw/missing.h @@ -159,7 +159,7 @@ typedef struct tagNMLVDISPINFOW { #endif #endif -#if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW) +#if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined(__DIGITALMARS__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW) #define HDN_GETDISPINFOW (HDN_FIRST-29) #if !wxCHECK_W32API_VERSION(2, 2) typedef struct { diff --git a/include/wx/platform.h b/include/wx/platform.h index 4d04491a58..c52ad430c1 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -297,5 +297,11 @@ #define wxCHECK_W32API_VERSION(maj, min) (0) #endif +#ifdef __SC__ + #ifdef __DMC__ + #define __DIGITALMARS__ + #endif +#endif + #endif /* _WX_PLATFORM_H_ */ diff --git a/samples/minimal/makefile.sc b/samples/minimal/makefile.sc index c55f65c7d7..5f574ba91e 100644 --- a/samples/minimal/makefile.sc +++ b/samples/minimal/makefile.sc @@ -8,9 +8,9 @@ TARGET=minimal include $(WXDIR)\src\makesc.env -minimal.exe: minimal.obj $(DEFFILE) minimal.res - *$(CC) $(LDFLAGS) -o$@ $** $(LIBS) - *$(RC) -k minimal.res +minimal.exe: minimal.obj + link $(LDFLAGS) $*, $@, $*, $(LIBS) + sc32.def: echo EXETYPE NT > sc32.def diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 2a7e01108e..c6b3721354 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -154,7 +154,7 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc, HBITMAP hbmpOld = (HBITMAP)SelectObject(hdcMem, hbmpCheck); // then draw a check mark into it -#if defined(__WIN32__) && !defined(__SC__) + RECT rect; rect.left = 0; rect.top = 0; @@ -162,22 +162,6 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc, rect.bottom = nCheckHeight; DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK); -#else - // In WIN16, draw a cross - HPEN blackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); - HPEN whiteBrush = (HPEN)GetStockObject(WHITE_BRUSH); - HPEN hPenOld = (HPEN)::SelectObject(hdcMem, blackPen); - HPEN hBrushOld = (HPEN)::SelectObject(hdcMem, whiteBrush); - ::SetROP2(hdcMem, R2_COPYPEN); - Rectangle(hdcMem, 0, 0, nCheckWidth, nCheckHeight); - MoveTo(hdcMem, 0, 0); - LineTo(hdcMem, nCheckWidth, nCheckHeight); - MoveTo(hdcMem, nCheckWidth, 0); - LineTo(hdcMem, 0, nCheckHeight); - ::SelectObject(hdcMem, hPenOld); - ::SelectObject(hdcMem, hBrushOld); - ::DeleteObject(blackPen); -#endif // finally copy it to screen DC and clean up BitBlt(hdc, x, y, nCheckWidth - 1, nCheckHeight, diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index 04dd7bc916..e470b3254b 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -431,6 +431,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len), return TRUE; } + #endif // wxUSE_DRAG_AND_DROP #endif // wxUSE_ENH_METAFILE diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 1e7606bcbe..7d04d9be55 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -373,6 +373,14 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, long WXUNUSED(flags), int desiredWidth, int desiredHeight) { +#ifdef __DIGITALMARS__ +//FIXME __DIGITALMARS__ April 2003 CE + // why no ExtractIcon in library + wxLogTrace(_T("iconload"), + _T("Returning false from wxICOFileHandler::Load because of DigitalMars compiler bug")); + + return false; +#else icon->UnRef(); // actual size @@ -475,6 +483,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, icon->SetSize(size.x, size.y); return icon->Ok(); +#endif // Digitalmars } bool wxICOResourceHandler::LoadIcon(wxIcon *icon, diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 72035afc13..37a26a971e 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -14,7 +14,7 @@ include ..\makesc.env DEBUG=0 -LIBTARGET = $(LIBDIR)\wx.lib +LIBTARGET = $(LIBDIR)\wx$(SC_SUFFIX).lib OPTIONS= @@ -242,8 +242,10 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\helpchm.obj \ $(MSWDIR)\helpwin.obj \ $(MSWDIR)\icon.obj \ + $(MSWDIR)\imaglist.obj \ $(MSWDIR)\iniconf.obj \ $(MSWDIR)\listbox.obj \ + $(MSWDIR)\listctrl.obj \ $(MSWDIR)\main.obj \ $(MSWDIR)\mdi.obj \ $(MSWDIR)\menu.obj \ @@ -254,6 +256,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\msgdlg.obj \ $(MSWDIR)\mslu.obj \ $(MSWDIR)\nativdlg.obj \ + $(MSWDIR)\notebook.obj \ $(MSWDIR)\ole\oleutils.obj \ $(MSWDIR)\ownerdrw.obj \ $(MSWDIR)\palette.obj \ @@ -270,7 +273,6 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\scrolbar.obj \ $(MSWDIR)\settings.obj \ $(MSWDIR)\slider95.obj \ - $(MSWDIR)\slidrmsw.obj \ $(MSWDIR)\snglinst.obj \ $(MSWDIR)\spinbutt.obj \ $(MSWDIR)\spinctrl.obj \ @@ -282,7 +284,6 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\tabctrl.obj \ $(MSWDIR)\taskbar.obj \ $(MSWDIR)\tbar95.obj \ - $(MSWDIR)\tbarmsw.obj \ $(MSWDIR)\textctrl.obj \ $(MSWDIR)\tglbtn.obj \ $(MSWDIR)\thread.obj \ @@ -300,26 +301,35 @@ MSWOBJS = $(MSWDIR)\accel.obj \ # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc. OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) -all: $(LIBTARGET) +all: MAKEARCHDIR $(LIBTARGET) + +MAKEARCHDIR: + @if not exist $(MSWINCDIR)\setup.h copy $(MSWINCDIR)\setup0.h $(MSWINCDIR)\setup.h + @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR) + @if not exist $(ARCHINCDIR)\wx\setup.h mkdir $(ARCHINCDIR)\wx + @if not exist $(ARCHINCDIR)\wx\setup.h copy $(MSWINCDIR)\setup.h $(ARCHINCDIR)\wx\setup.h $(LIBTARGET): $(OBJECTS) -del $(LIBTARGET) *lib /PAGESIZE:512 $(LIBTARGET) y $(OBJECTS), nul; clean: + -del $(COMMDIR)\*.obj + -del $(MSWDIR)\*.obj + -del $(GENDIR)\*.obj -del *.obj -del $(LIBTARGET) -$(COMMDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c - -$(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c - copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c - -$(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c - copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c - -# $(COMMDIR)\cmndata.obj: $(COMMDIR)\cmndata.cpp -# *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj +## $(COMMDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c +## +## $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c +## copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c +## +## $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c +## copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c +## +### $(COMMDIR)\cmndata.obj: $(COMMDIR)\cmndata.cpp +### *$(CC) -c $(CFLAGS) -I$(INCLUDE) $(OPTIONS) $(COMMDIR)\cmndata.cpp -o$(COMMDIR)\cmndata.obj MFTYPE=sc makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 7d0164a3c0..21fc67e840 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -191,7 +191,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const if ( exflags ) { -#if !defined(__WIN16__) && !defined(__SC__) +#if !defined(__WIN16__) if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ) { if ( style & wxFRAME_TOOL_WINDOW ) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 6d1b87409e..c941c45a57 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -180,6 +180,9 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) // shouldn't use winsock.dll (a.k.a. ws2_32.dll) at all so only use this // code if we link with it anyhow #if wxUSE_SOCKETS + //FIXME __DIGITALMARS__ why is using sockets not properly turned off in setup.h ?? + // find which library should contain sockets for Digital Mars CE April 2003 +#ifndef __DIGITALMARS__ WSADATA wsa; if ( WSAStartup(MAKEWORD(1, 1), &wsa) == 0 ) { @@ -215,6 +218,8 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) return TRUE; } } +#endif //__DIGITALMARS__ + #endif // wxUSE_SOCKETS #endif // Win32 @@ -1009,7 +1014,7 @@ wxString wxGetOsDescription() int wxGetOsVersion(int *majorVsn, int *minorVsn) { -#if defined(__WIN32__) && !defined(__SC__) +#if defined(__WIN32__) static int ver = -1, major = -1, minor = -1; if ( ver == -1 ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 7dec91edbc..1d21f036b7 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1479,10 +1479,12 @@ void wxWindowMSW::Update() // drag and drop // --------------------------------------------------------------------------- -#if wxUSE_DRAG_AND_DROP +//FIXME __DIGITALMARS__ does not honor drag drop in setup.h +#if wxUSE_DRAG_AND_DROP void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget) { +#ifndef __DIGITALMARS__ if ( m_dropTarget != 0 ) { m_dropTarget->Revoke(m_hWnd); delete m_dropTarget; @@ -1491,17 +1493,19 @@ void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget) m_dropTarget = pDropTarget; if ( m_dropTarget != 0 ) m_dropTarget->Register(m_hWnd); +#endif // __DIGITALMARS__ } - #endif // wxUSE_DRAG_AND_DROP // old style file-manager drag&drop support: we retain the old-style // DragAcceptFiles in parallel with SetDropTarget. void wxWindowMSW::DragAcceptFiles(bool accept) { +#ifndef __DIGITALMARS__ HWND hWnd = GetHwnd(); if ( hWnd ) ::DragAcceptFiles(hWnd, (BOOL)accept); +#endif } // ---------------------------------------------------------------------------- @@ -1932,7 +1936,11 @@ bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y) long wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { if ( m_oldWndProc ) +#ifdef __DIGITALMARS__ + return ::CallWindowProc( (FARPROC) m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam); +#else return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam); +#endif else return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam); } @@ -3422,7 +3430,10 @@ bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus)) bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) { -#ifndef __WXMICROWIN__ +//FIX ME __DIGITALMARS__ +#if defined (__WXMICROWIN__) || defined (__DIGITALMARS__) + return FALSE; +#else // __WXMICROWIN__ HDROP hFilesInfo = (HDROP) wParam; // Get the total number of files dropped @@ -3457,8 +3468,6 @@ bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) event.m_pos.y = dropPoint.y; return GetEventHandler()->ProcessEvent(event); -#else // __WXMICROWIN__ - return FALSE; #endif }