update to make digitalmars compile

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Chris Elliott
2003-04-19 18:15:17 +00:00
parent e668651137
commit 4ce1efe123
15 changed files with 97 additions and 56 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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); }

View File

@@ -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

View File

@@ -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,

View File

@@ -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 {

View File

@@ -297,5 +297,11 @@
#define wxCHECK_W32API_VERSION(maj, min) (0)
#endif
#ifdef __SC__
#ifdef __DMC__
#define __DIGITALMARS__
#endif
#endif
#endif /* _WX_PLATFORM_H_ */

View File

@@ -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

View File

@@ -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,

View File

@@ -431,6 +431,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len),
return TRUE;
}
#endif // wxUSE_DRAG_AND_DROP
#endif // wxUSE_ENH_METAFILE

View File

@@ -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,

View File

@@ -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

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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
}