From 8fb3a512a85572ebf4b4f46eaf536727dfe4e01e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 24 Oct 1999 19:50:17 +0000 Subject: [PATCH] Fixes for 16-bit compilation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/bcc.t | 12 ++++++++++-- distrib/msw/tmake/dos.t | 27 +++++++++++++-------------- docs/msw/install.txt | 17 +++++++++++------ include/wx/dc.h | 7 ++++++- include/wx/defs.h | 10 ++++++++++ include/wx/msw/curico.h | 6 ++++++ include/wx/msw/curicop.h | 16 ++++++++++++++++ include/wx/msw/dib.h | 5 +++++ include/wx/msw/setup0.h | 6 +++--- src/common/dobjcmn.cpp | 4 ++++ src/makemsc.env | 2 +- src/msw/font.cpp | 3 ++- src/msw/makefile.bcc | 21 ++++++++++++--------- src/msw/makefile.dos | 39 ++++++++++++++++++++------------------- src/msw/makefile.sc | 10 +++++----- src/msw/menu.cpp | 7 +++++++ src/msw/menuitem.cpp | 6 ++++++ src/msw/utils.cpp | 6 ++++++ 18 files changed, 143 insertions(+), 61 deletions(-) diff --git a/distrib/msw/tmake/bcc.t b/distrib/msw/tmake/bcc.t index 1f83d36d89..3fe2a8915c 100644 --- a/distrib/msw/tmake/bcc.t +++ b/distrib/msw/tmake/bcc.t @@ -2,6 +2,11 @@ #! File: bcc.t #! Purpose: tmake template file from which makefile.bcc is generated by running #! tmake -t bcc wxwin.pro -o makefile.bcc +#! +#! TODO: +#! - resourc2.obj is not correctly generated (see list and target). +#! - cpp is incorrectly substituted into filenames containing 'obj' +#! #! Author: Vadim Zeitlin #! Created: 14.07.99 #! Version: $Id$ @@ -36,7 +41,7 @@ } #! special hack for Borland in 16 bits needs this file - $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.cpp'; + $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.obj'; foreach $file (sort keys %wxMSW) { #! don't take files not appropriate for 16-bit Windows @@ -140,7 +145,10 @@ wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET) $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS) erase $(LIBTARGET) tlib $(LIBTARGET) /P1024 @&&! -+$(OBJECTS:.obj =.obj +) +$(PERIPH_LIBS:.lib =.lib +) ++$(COMMONOBJS:.obj =.obj +)\ ++$(GENERICOBJS:.obj =.obj +)\ ++$(MSWOBJS:.obj =.obj +)\ ++$(PERIPH_LIBS:.lib =.lib +) ! dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h diff --git a/distrib/msw/tmake/dos.t b/distrib/msw/tmake/dos.t index b8e97b7ed3..54d017f047 100644 --- a/distrib/msw/tmake/dos.t +++ b/distrib/msw/tmake/dos.t @@ -117,18 +117,7 @@ MSWOBJS = #$ ExpandList("WXMSWOBJS"); OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) # Normal, static library -all: $(DUMMYOBJ) $(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib - - -# $(WXDIR)\lib\wx.lib: dummy.obj $(OBJECTS) $(PERIPH_LIBS) -# -erase $(LIBTARGET) -# lib /PAGESIZE:128 @<< -# $(LIBTARGET) -# y -# $(OBJECTS) $(PERIPH_LIBS) -# nul -# ; -# << +all: $(DUMMYOBJ) $(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib $(WXDIR)\lib\wx4.lib $(WXDIR)\lib\wx1.lib: $(COMMONOBJS) $(PERIPH_LIBS) -erase $(WXDIR)\lib\wx1.lib @@ -150,12 +139,22 @@ nul ; << -$(WXDIR)\lib\wx3.lib: $(MSWOBJS) +$(WXDIR)\lib\wx3.lib: $(MSWOBJS1) -erase $(WXDIR)\lib\wx3.lib lib /PAGESIZE:128 @<< $(WXDIR)\lib\wx3.lib y -$(MSWOBJS) +$(MSWOBJS1) +nul +; +<< + +$(WXDIR)\lib\wx4.lib: $(MSWOBJS2) + -erase $(WXDIR)\lib\wx4.lib + lib /PAGESIZE:128 @<< +$(WXDIR)\lib\wx4.lib +y +$(MSWOBJS2) nul ; << diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 100a42f5a6..f5fafc6817 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -178,8 +178,8 @@ if necessary) that the project settings, especially the list of defined symbols, struct packing, etc. are exactly the same for all items in the project. After this, delete everything (including PCH) and recompile. -Visual C++ 1.5 compilation --------------------------- +Visual C++ 1.5 compilation (16-bit) +----------------------------------- 1. Make sure your WXWIN variable is set, and uses the FAT (short name) form. @@ -215,7 +215,11 @@ Note (1): the wxWindows library and (some) samples compile in 16-bit mode using makefile.bcc, but at present the wxWindows resource system is switched off in this mode. See issues.txt for details. -Note (2): the wxWindows makefiles assume byte structure alignment. Please +Note (2): unfortunately most samples won't link in 16-bit mode, +because the automatic data segment exceeds 64K. The minimal +sample links and runs, however. + +Note (3): the wxWindows makefiles assume byte structure alignment. Please make sure that your own project or makefile settings use the same alignment, or you could experience mysterious crashes. To change the alignment, add a suitable option to the $(CFG) target code @@ -274,11 +278,12 @@ Metrowerks CodeWarrior compilation Further project files for samples will be available in due course. -NOTES: - -You need CodeWarrior Pro 4 plus the patches to 4.1 from the +Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the Metrowerks Web site. +Note (2): unfortunately these files are not yet up-to-date for the +current release. + Symantec C++ compilation ------------------------ diff --git a/include/wx/dc.h b/include/wx/dc.h index 2c66232f81..2388b401f8 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -244,7 +244,12 @@ public: void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const { DoGetClippingBox(x, y, w, h); } void GetClippingBox(wxRect& rect) const - { DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); } + { + // Necessary to use intermediate variables for 16-bit compilation + wxCoord x, y, w, h; + DoGetClippingBox(&x, &y, &w, &h); + rect.x = x; rect.y = y; rect.width = w; rect.height = h; + } // text extent // ----------- diff --git a/include/wx/defs.h b/include/wx/defs.h index bf12c02ae0..818540cede 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1607,6 +1607,16 @@ typedef unsigned short WORD; #endif typedef WXHWND WXWidget; + +#if defined(__BORLANDC__) && !defined(__WIN32__) +#ifndef LPTSTR +#define LPTSTR LPSTR +#endif +#ifndef LPCTSTR +#define LPCTSTR LPSTR +#endif +#endif + #endif // MSW #ifdef __WXMOTIF__ diff --git a/include/wx/msw/curico.h b/include/wx/msw/curico.h index 3b8c83375a..a4f4394350 100644 --- a/include/wx/msw/curico.h +++ b/include/wx/msw/curico.h @@ -9,6 +9,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#ifndef _WX_CURICO_H_ +#define _WX_CURICO_H_ + HICON ReadIconFile( wxChar *szFileName, HINSTANCE hInst, int *W = 0, int *H = 0); HCURSOR ReadCursorFile( wxChar *szFileName, HINSTANCE hInst, @@ -20,3 +23,6 @@ HICON CursorToIcon( wxChar *szFileName, HINSTANCE hInst, HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint); HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap); + +#endif + diff --git a/include/wx/msw/curicop.h b/include/wx/msw/curicop.h index 5023b7cff9..2be9ce59a7 100644 --- a/include/wx/msw/curicop.h +++ b/include/wx/msw/curicop.h @@ -1,3 +1,17 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: curicop.h +// Purpose: Private routines for cursor/icon handling +// Author: Various +// Modified by: +// Created: 01/02/97 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_CURICOP_H_ +#define _WX_CURICOP_H_ + // PRIVATE STUFF FOLLOWS UNTIL END // Header signatures for various resources @@ -61,3 +75,5 @@ typedef struct tagICONFILERES ICONFILERES; HANDLE ReadIcon( wxChar *szFileName, int *W = 0, int *H = 0); HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst); +#endif + diff --git a/include/wx/msw/dib.h b/include/wx/msw/dib.h index 8ba5cc6e1f..1e19b76b6c 100644 --- a/include/wx/msw/dib.h +++ b/include/wx/msw/dib.h @@ -9,6 +9,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#ifndef _WX_DIB_H_ +#define _WX_DIB_H_ + // Save (device dependent) wxBitmap as a DIB bool wxSaveBitmap(wxChar *filename, wxBitmap *bitmap, wxColourMap *colourmap = NULL); @@ -24,3 +27,5 @@ HANDLE wxReadDIB2(LPTSTR lpFileName); LPSTR wxFindDIBBits (LPSTR lpbi); HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo); +#endif + diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index adfca344d1..f78fbf9e02 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -397,15 +397,15 @@ #endif #if defined(__WXMSW__) && defined(__WATCOMC__) -#undef wxUSE_ODBC -#define wxUSE_ODBC 0 - #undef wxUSE_LIBJPEG #define wxUSE_LIBJPEG 0 #endif #if defined(__WXMSW__) && !defined(__WIN32__) +#undef wxUSE_SOCKETS +#define wxUSE_SOCKETS 0 + #undef wxUSE_THREADS #define wxUSE_THREADS 0 diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 50b6fe0718..53a4041c7b 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -293,6 +293,8 @@ bool wxCustomDataObject::SetData(size_t size, const void *buf) // some common dnd related code // ============================================================================ +#if wxUSE_DRAG_AND_DROP + #include "wx/dnd.h" // ---------------------------------------------------------------------------- @@ -331,3 +333,5 @@ wxDragResult wxFileDropTarget::OnData(wxCoord x, wxCoord y, wxDragResult def) return OnDropFiles(x, y, dobj->GetFilenames()) ? def : wxDragNone; } +#endif + diff --git a/src/makemsc.env b/src/makemsc.env index 28cf0817af..07a591e0cd 100644 --- a/src/makemsc.env +++ b/src/makemsc.env @@ -20,7 +20,7 @@ WXDIR = $(WXWIN) WXINC = $(WXDIR)\include -WXLIB=$(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib +WXLIB=$(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib $(WXDIR)\lib\wx4.lib # Suffixes OBJSUFF=obj diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 9f3858a2bd..50daad4e83 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -342,7 +342,7 @@ bool wxFont::RealizeResource() case wxFONTENCODING_CP1250: charset = ANSI_CHARSET; break; - +#if !defined(__WIN16__) case wxFONTENCODING_ISO8859_2: case wxFONTENCODING_CP1252: charset = EASTEUROPE_CHARSET; @@ -377,6 +377,7 @@ bool wxFont::RealizeResource() case wxFONTENCODING_ISO8859_11: charset = THAI_CHARSET; break; +#endif // BC++ 16-bit case wxFONTENCODING_CP437: charset = OEM_CHARSET; diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index 67c9152640..815b4ba22d 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -176,7 +176,7 @@ COMMONOBJS = \ $(MSWDIR)\wxexpr.obj \ $(MSWDIR)\zipstrm.obj \ $(MSWDIR)\zstream.obj \ - ${MSWDIR}\resourc2.cpp + ${MSWDIR}\resourc2.obj MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\app.obj \ @@ -263,9 +263,14 @@ wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET) $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS) erase $(LIBTARGET) tlib $(LIBTARGET) /P1024 @&&! -+$(OBJECTS:.obj =.obj +) +$(PERIPH_LIBS:.lib =.lib +) ++$(COMMONOBJS:.obj =.obj +)\ ++$(GENERICOBJS:.obj =.obj +)\ ++$(MSWOBJS:.obj =.obj +)\ ++$(PERIPH_LIBS:.lib =.lib +) ! +#+$(OBJECTS:.obj =.obj +) + dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h @@ -349,7 +354,7 @@ $(MSWDIR)\frame.obj: $(MSWDIR)\frame.$(SRCSUFF) $(MSWDIR)\gaugemsw.obj: $(MSWDIR)\gaugemsw.$(SRCSUFF) -$(MSWDIR)\gdiobj.obj: $(MSWDIR)\gdi$(SRCSUFF).obj +$(MSWDIR)\gdiobj.obj: $(MSWDIR)\gdiobj.$(SRCSUFF) $(MSWDIR)\gsocket.obj: $(MSWDIR)\gsocket.c @@ -464,7 +469,7 @@ $(MSWDIR)\dcbase.obj: $(COMMDIR)\dcbase.$(SRCSUFF) $(MSWDIR)\dlgcmn.obj: $(COMMDIR)\dlgcmn.$(SRCSUFF) -$(MSWDIR)\dobjcmn.obj: $(COMMDIR)\d$(SRCSUFF)cmn.obj +$(MSWDIR)\dobjcmn.obj: $(COMMDIR)\dobjcmn.$(SRCSUFF) $(MSWDIR)\docmdi.obj: $(COMMDIR)\docmdi.$(SRCSUFF) @@ -530,9 +535,9 @@ $(MSWDIR)\module.obj: $(COMMDIR)\module.$(SRCSUFF) $(MSWDIR)\mstream.obj: $(COMMDIR)\mstream.$(SRCSUFF) -$(MSWDIR)\object.obj: $(COMMDIR)\$(SRCSUFF)ect.obj +$(MSWDIR)\object.obj: $(COMMDIR)\object.$(SRCSUFF) -$(MSWDIR)\objstrm.obj: $(COMMDIR)\$(SRCSUFF)strm.obj +$(MSWDIR)\objstrm.obj: $(COMMDIR)\objstrm.$(SRCSUFF) $(MSWDIR)\paper.obj: $(COMMDIR)\paper.$(SRCSUFF) @@ -590,9 +595,7 @@ $(MSWDIR)\zipstrm.obj: $(COMMDIR)\zipstrm.$(SRCSUFF) $(MSWDIR)\zstream.obj: $(COMMDIR)\zstream.$(SRCSUFF) -${MSWDIR}\resourc2.cpp: ${COMMDIR}\resourc2.cpp - - +${MSWDIR}\resourc2.obj: ${COMMDIR}\resourc2.$(SRCSUFF) ######################################################## # Generic objects (not always compiled, depending on diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index 94e781a7dd..9110b2d273 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -165,7 +165,7 @@ COMMONOBJS = \ $(COMMDIR)\zipstrm.obj \ $(COMMDIR)\zstream.obj -MSWOBJS = $(MSWDIR)\accel.obj \ +MSWOBJS1 = $(MSWDIR)\accel.obj \ $(MSWDIR)\app.obj \ $(MSWDIR)\bitmap.obj \ $(MSWDIR)\bmpbuttn.obj \ @@ -215,8 +215,9 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\nativdlg.obj \ $(MSWDIR)\ownerdrw.obj \ $(MSWDIR)\palette.obj \ - $(MSWDIR)\pen.obj \ - $(MSWDIR)\penwin.obj \ + $(MSWDIR)\pen.obj + +MSWOBJS2 = $(MSWDIR)\penwin.obj \ $(MSWDIR)\printdlg.obj \ $(MSWDIR)\printwin.obj \ $(MSWDIR)\radiobox.obj \ @@ -245,21 +246,11 @@ MSWOBJS = $(MSWDIR)\accel.obj \ # $(OLEDIR)\xpmhand \ # $(OLEDIR)\pnghand \ -OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) +OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS1) $(MSWOBJS2) # Normal, static library -all: $(DUMMYOBJ) $(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib - +all: $(DUMMYOBJ) $(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib $(WXDIR)\lib\wx4.lib -# $(WXDIR)\lib\wx.lib: dummy.obj $(OBJECTS) $(PERIPH_LIBS) -# -erase $(LIBTARGET) -# lib /PAGESIZE:128 @<< -# $(LIBTARGET) -# y -# $(OBJECTS) $(PERIPH_LIBS) -# nul -# ; -# << $(WXDIR)\lib\wx1.lib: $(COMMONOBJS) $(PERIPH_LIBS) -erase $(WXDIR)\lib\wx1.lib @@ -281,12 +272,22 @@ nul ; << -$(WXDIR)\lib\wx3.lib: $(MSWOBJS) +$(WXDIR)\lib\wx3.lib: $(MSWOBJS1) -erase $(WXDIR)\lib\wx3.lib lib /PAGESIZE:128 @<< $(WXDIR)\lib\wx3.lib y -$(MSWOBJS) +$(MSWOBJS1) +nul +; +<< + +$(WXDIR)\lib\wx4.lib: $(MSWOBJS2) + -erase $(WXDIR)\lib\wx4.lib + lib /PAGESIZE:128 @<< +$(WXDIR)\lib\wx4.lib +y +$(MSWOBJS2) nul ; << @@ -477,9 +478,9 @@ $(MSWDIR)/gdiobj.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << -$(MSWDIR)/gsocket.obj: $*.$(SRCSUFF) +$(MSWDIR)/gsocket.obj: $*.c cl @<< -$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +$(CPPFLAGS2) /Fo$@ /c $*.c << $(MSWDIR)/helpwin.obj: $*.$(SRCSUFF) diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 4ab10e6849..0c58317cb1 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -143,7 +143,7 @@ COMMONOBJS = \ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\app.obj \ - $(MSWDIR)\automtn.obj \ + $(MSWDIR)\ole\automtn.obj \ $(MSWDIR)\bitmap.obj \ $(MSWDIR)\bmpbuttn.obj \ $(MSWDIR)\brush.obj \ @@ -172,8 +172,8 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\dibutils.obj \ $(MSWDIR)\dirdlg.obj \ $(MSWDIR)\dragimag.obj \ - $(MSWDIR)\dropsrc.obj \ - $(MSWDIR)\droptgt.obj \ + $(MSWDIR)\ole\dropsrc.obj \ + $(MSWDIR)\ole\droptgt.obj \ $(MSWDIR)\filedlg.obj \ $(MSWDIR)\font.obj \ $(MSWDIR)\fontdlg.obj \ @@ -194,7 +194,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\minifram.obj \ $(MSWDIR)\msgdlg.obj \ $(MSWDIR)\nativdlg.obj \ - $(MSWDIR)\oleutils.obj \ + $(MSWDIR)\ole\oleutils.obj \ $(MSWDIR)\ownerdrw.obj \ $(MSWDIR)\palette.obj \ $(MSWDIR)\pen.obj \ @@ -227,7 +227,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\tooltip.obj \ $(MSWDIR)\utils.obj \ $(MSWDIR)\utilsexc.obj \ - $(MSWDIR)\uuid.obj \ + $(MSWDIR)\ole\uuid.obj \ $(MSWDIR)\wave.obj \ $(MSWDIR)\window.obj \ $(MSWDIR)\xpmhand.obj diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4cca3f9e59..de144548e1 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -261,7 +261,14 @@ void wxMenu::Append(wxMenuItem *pItem) { // menu is just a normal string (passed in data parameter) flags |= MF_STRING; + +// Don't know what the correct cast should be, but it doesn't +// compile in BC++/16-bit without this cast. +#if !defined(__WIN32__) + pData = (char*) (const char*) label; +#else pData = label; +#endif } if ( !::AppendMenu(GetHmenu(), flags, id, pData) ) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index f40498487b..a4f038f875 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -203,7 +203,13 @@ void wxMenuItem::SetName(const wxString& strName) #endif //owner drawn { flagsOld |= MF_STRING; +// Don't know what the correct cast should be, but it doesn't +// compile in BC++/16-bit without this cast. +#if !defined(__WIN32__) + data = (char*) (const char*) strName; +#else data = strName; +#endif } if ( ::ModifyMenu(hMenu, id, diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 38723ea82c..3555808464 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -482,7 +482,13 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn) bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) { if (file != wxT("")) +// Don't know what the correct cast should be, but it doesn't +// compile in BC++/16-bit without this cast. +#if !defined(__WIN32__) + return (WritePrivateProfileString((const char*) section, (const char*) entry, (const char*) value, (const char*) file) != 0); +#else return (WritePrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)value, (LPCTSTR)WXSTRINGCAST file) != 0); +#endif else return (WriteProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)WXSTRINGCAST value) != 0); } -- 2.45.2