From 7d5848668df9cd29d08c81b43ff459da946a21e4 Mon Sep 17 00:00:00 2001 From: Chris Elliott Date: Wed, 18 Jun 2003 12:09:16 +0000 Subject: [PATCH] fix DMars compilation to use precompiled headers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wxprec.h | 2 +- samples/dialogs/makefile.sc | 9 ++++----- src/common/dobjcmn.cpp | 12 +++--------- src/common/imagjpeg.cpp | 2 +- src/makesc.env | 8 ++++++-- src/msw/app.cpp | 4 ---- src/msw/clipbrd.cpp | 4 ---- src/msw/dib.cpp | 3 --- src/msw/makefile.sc | 12 ++++++++++-- src/msw/mdi.cpp | 4 ---- src/msw/ole/dataobj.cpp | 13 ------------- src/msw/utils.cpp | 4 ---- src/msw/window.cpp | 16 ---------------- src/png/pngconf.h | 2 +- src/zlib/zconf.h | 2 +- 15 files changed, 27 insertions(+), 70 deletions(-) diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h index 4b215bf0dc..76f16b4108 100644 --- a/include/wx/wxprec.h +++ b/include/wx/wxprec.h @@ -15,7 +15,7 @@ // check if to use precompiled headers: do it for most Windows compilers unless // adding DigitalMars here appears to amke it slower! // explicitly disabled by defining NOPCH -#if ((defined(__BORLANDC__) || defined(__VISUALC__) || defined(__WATCOMC__)) && defined(__WXMSW__)) || defined(__VISAGECPP__) || defined(__MWERKS__) +#if ((defined(__BORLANDC__) || defined(__VISUALC__) || defined(__DIGITALMARS__) || defined(__WATCOMC__)) && defined(__WXMSW__)) || defined(__VISAGECPP__) || defined(__MWERKS__) #if !defined(NOPCH) #define WX_PRECOMP #endif diff --git a/samples/dialogs/makefile.sc b/samples/dialogs/makefile.sc index c2a1671953..96e44a6ae4 100644 --- a/samples/dialogs/makefile.sc +++ b/samples/dialogs/makefile.sc @@ -1,7 +1,6 @@ -# Symantec C++ makefile -WXDIR = ..\.. -EXTRALIBS= +#Makefile from wxHatch for Symantec/Digital Mars compiler +WXDIR=..\..\..\wxWindows.25 TARGET=dialogs -OBJECTS = $(TARGET).obj +OBJECTS = $(TARGET).obj +EXTRALIBS = include $(WXDIR)\src\makeprog.sc - diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 6560200b01..658449d91f 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -141,9 +141,7 @@ wxDataObjectComposite::GetPreferredFormat(Direction WXUNUSED(dir)) const } #if defined(__WXMSW__) -#ifdef __DIGITALMARS__ -extern "C" -#endif + size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ) { wxDataObjectSimple *dataObj = GetObject(format); @@ -154,9 +152,7 @@ size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ) return dataObj->GetBufferOffset( format ); } -#ifdef __DIGITALMARS__ -extern "C" -#endif + const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, size_t* size, const wxDataFormat& format ) @@ -169,9 +165,7 @@ const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, return dataObj->GetSizeFromBuffer( buffer, size, format ); } -#ifdef __DIGITALMARS__ -extern "C" -#endif + void* wxDataObjectComposite::SetSizeInBuffer( void* buffer, size_t size, const wxDataFormat& format ) { diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index d1588229f9..98008589d1 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -33,7 +33,7 @@ // This causes a conflict with jmorecfg.h header from libjpeg, so we have // to make sure libjpeg won't try to define boolean itself. This is done by // defining HAVE_BOOLEAN. -#if defined(__WXMSW__) && (defined(__MWERKS__) || (defined(__WATCOMC__) && __WATCOMC__ < 1200)) +#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__) || (defined(__WATCOMC__) && __WATCOMC__ < 1200)) #define HAVE_BOOLEAN #include #endif diff --git a/src/makesc.env b/src/makesc.env index 607d44e010..dac29a2404 100644 --- a/src/makesc.env +++ b/src/makesc.env @@ -3,6 +3,7 @@ SC_SUFFIX=_sc ####WXDIR = $(WXWIN) +WXOUTDIR=$(WXDIR)\d_mars INCDIR = $(WXDIR)\include CONTRIBINCDIR = $(WXDIR)\contrib\include MSWINCDIR = $(WXDIR)\include\wx\msw @@ -27,7 +28,10 @@ RC=rcc # WIN32 settings # -H ... fix to use directory -CFLAGS = -o -mn -W -H -D__NT__ -DWIN32 -D__WIN32__ -D__WIN95__ -D__WINDOWS__ -D__WXMSW__ -D__SC__ -D__WXDEBUG__ $(EXTRACPPFLAGS) +##CFLAGS = -o -mn -W -H -D__NT__ -DWIN32 -D__WIN32__ -D__WIN95__ -D__WINDOWS__ -D__WXMSW__ -D__SC__ -D__WXDEBUG__ $(EXTRACPPFLAGS) +CFLAGS = -mn -D_WINDOWS -6 -a8 -Nc -c -H -HD$(WXOUTDIR) -HO- -DWXMSW -D__WIN32__ -D__WIN95__ -D__WXDEBUG__ $(EXTRACPPFLAGS) +CPPFLAGS = -cpp -Ae -Ar + LINKER = link # possible bug with putting d on any extralibs if we have debug and release versions one day LDFLAGS = $(EXTRALDFLAGS) @@ -35,7 +39,7 @@ LIBS=$(WXLIB) $(EXTRALIBS) $(SUPPORTLIBS) advapi32 comctl32 comdlg32 ctl3d32 gc .$(SRCSUFF).obj: - *$(CC) -c $(CFLAGS) $(INCLUDE) $(OPTIONS) $< -o$@ + *$(CC) -c $(CPPFLAGS) $(CFLAGS) $(INCLUDE) $(OPTIONS) $< -o$@ # -Jm: relaxed type checking only for .C files .c.obj: diff --git a/src/msw/app.cpp b/src/msw/app.cpp index d5a953bbcb..0ece73173d 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -151,11 +151,7 @@ HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL; HBRUSH wxDisableButtonBrush = (HBRUSH) 0; -#ifdef __DIGITALMARS__ -extern "C" LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM); -#else LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM); -#endif // FIXME wxUSE_ON_FATAL_EXCEPTION is only supported for VC++ now because it // needs compiler support for Win32 SEH. Others (especially Borland) diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 875c9f838a..bfb991866d 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -174,10 +174,6 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) } } -#ifdef __DIGITALMARS__ -extern "C" HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp); -#endif - bool wxSetClipboardData(wxDataFormat dataFormat, const void *data, diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 31621f2734..9aa457995a 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -440,9 +440,6 @@ size_t wxDIB::ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp) } /* static */ -#ifdef __DIGITALMARS__ -extern "C" -#endif HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) { // first calculate the size needed diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 686132b9d6..d0baac215c 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -327,13 +327,14 @@ MSWOBJS = $(MSWDIR)\accel.obj \ # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc. OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(HTMLOBJS) -all: MAKEARCHDIR MAKELIBS $(LIBTARGET) zlib png jpeg tiff regex +all: MAKEARCHDIR MAKELIBS PCH $(LIBTARGET) zlib png jpeg tiff regex 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 + @if not exist $(WXOUTDIR)\nul mkdir $(WXOUTDIR) #build our own copies of missing libraries MAKELIBS: @@ -344,7 +345,7 @@ $(LIBTARGET): $(OBJECTS) -del $(LIBTARGET) *lib /PAGESIZE:512 $(LIBTARGET) y $(OBJECTS), nul; -clean: clean_msw clean_zlib clean_png clean_jpeg clean_tiff clean_regex +clean: clean_msw clean_zlib clean_png clean_jpeg clean_tiff clean_regex clean_pch clean_msw: -del $(COMMDIR)\*.obj @@ -356,6 +357,13 @@ clean_msw: -del ole\*.obj -del $(LIBTARGET) +PCH: $(INCDIR)\wx\wxprec.h + dmc $(CPPFLAGS) $(CFLAGS) $(INCLUDE) -HF$(WXOUTDIR)\wxprec.SYM -o$(WXOUTDIR)\wxprec.PCO $(INCDIR)\wx\wxprec.h + +clean_pch: + del $(WXOUTDIR)\*.sym + del $(WXOUTDIR)\*.PCO + png: make -f $(WXDIR)\src\png\makefile.sc FINAL=$(FINAL) diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index d87cf8ab65..a00557187d 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -68,11 +68,7 @@ extern wxMenu *wxCurrentPopupMenu; extern const wxChar *wxMDIFrameClassName; // from app.cpp extern const wxChar *wxMDIChildFrameClassName; extern const wxChar *wxMDIChildFrameClassNameNoRedraw; -#ifdef __DIGITALMARS__ -extern "C" void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win); -#else extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win); -#endif extern void wxRemoveHandleAssociation(wxWindow *win); static HWND invalidHandle = 0; diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 7ecdb81d3b..b554e126cd 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -410,19 +410,6 @@ STDMETHODIMP wxIDataObject::GetDataHere(FORMATETC *pformatetc, return S_OK; } -#ifdef __DIGITALMARS__ -extern "C" -size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ); - -extern "C" -const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, - size_t* size, - const wxDataFormat& format ) ; -extern "C" -void* wxDataObjectComposite::SetSizeInBuffer( void* buffer, size_t size, - const wxDataFormat& format ) ; - -#endif // set data functions STDMETHODIMP wxIDataObject::SetData(FORMATETC *pformatetc, diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 0b2827e0e7..dc8b9f8c31 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1316,11 +1316,7 @@ static HCURSOR gs_wxBusyCursor = 0; // new, busy cursor static HCURSOR gs_wxBusyCursorOld = 0; // old cursor static int gs_wxBusyCursorCount = 0; -#ifdef __DIGITALMARS__ -extern "C" HCURSOR wxGetCurrentBusyCursor() -#else extern HCURSOR wxGetCurrentBusyCursor() -#endif { return gs_wxBusyCursor; } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3dc135954b..e1d9ce5965 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -176,13 +176,8 @@ static bool gs_hasStdCmap = FALSE; // --------------------------------------------------------------------------- // the window proc for all our windows -#ifdef __DIGITALMARS__ -extern "C" LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam); -#else LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -#endif #ifdef __WXDEBUG__ @@ -190,11 +185,7 @@ LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, #endif //__WXDEBUG__ void wxRemoveHandleAssociation(wxWindowMSW *win); -#ifdef __DIGITALMARS__ -extern "C" void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win); -#else extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win); -#endif wxWindow *wxFindWinFromHandle(WXHWND hWnd); // this magical function is used to translate VK_APPS key presses to right @@ -1739,11 +1730,7 @@ 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); } @@ -3309,9 +3296,6 @@ bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) #endif } -#ifdef __DIGITALMARS__ -extern "C" HCURSOR wxGetCurrentBusyCursor(); -#endif bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd), short nHitTest, diff --git a/src/png/pngconf.h b/src/png/pngconf.h index e4fbd8c41c..7b60f45b5b 100644 --- a/src/png/pngconf.h +++ b/src/png/pngconf.h @@ -227,7 +227,7 @@ */ #ifndef MACOS # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) + defined(THINK_C) || (defined(__SC__) && !defined(__DMC__))|| defined(TARGET_OS_MAC) # define MACOS # endif #endif diff --git a/src/zlib/zconf.h b/src/zlib/zconf.h index e656bf28d2..3a1c213a03 100644 --- a/src/zlib/zconf.h +++ b/src/zlib/zconf.h @@ -87,7 +87,7 @@ #endif /* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||(defined(__SC__) && !defined(__DMC__)) # define NO_DUMMY_DECL #endif -- 2.45.2