From: Vadim Zeitlin Date: Tue, 23 Oct 2001 20:43:23 +0000 (+0000) Subject: applied patch 473558: fixes for CW compilation under MSW X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/de85a884d77ad5a29b418b343d4d3cc99c127b5e applied patch 473558: fixes for CW compilation under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 6556f39cd6..c2aaa0c09b 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -71,7 +71,8 @@ public: wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") ); if (wcs) { -#if (defined(__BORLANDC__) && (__BORLANDC__ > 0x530)) +#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) size_t siz = (std::wcslen(wcs)+1)*sizeof(wchar_t); #else size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t); diff --git a/include/wx/filefn.h b/include/wx/filefn.h index d4e1cbe48c..75665d066d 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -66,7 +66,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; // ---------------------------------------------------------------------------- // Microsoft compiler loves underscores, feed them to it -#if defined( __VISUALC__ ) || wxCHECK_W32API_VERSION( 0, 5 ) +#if defined( __VISUALC__ ) || wxCHECK_W32API_VERSION( 0, 5 ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) // functions #define wxClose _close #define wxRead _read diff --git a/src/common/file.cpp b/src/common/file.cpp index 667b99a32c..0973ec9c38 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -88,6 +88,9 @@ #ifndef __MWERKS__ #include // needed for stat #include // stat +#elif ( defined(__MWERKS__) && defined(__WXMSW__) ) + #include // needed for stat + #include // stat #endif #if defined(__BORLANDC__) || defined(_MSC_VER) diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index ba47b870f9..d0cda3912d 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -28,7 +28,12 @@ #if wxUSE_LONGLONG #include "wx/longlong.h" +#if defined(__MWERKS__) && defined(__WXMSW__) +#include // for memset() +#else #include // for memset() +#endif + #include // for fabs() // ============================================================================ diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 5f5ae4b89f..4a7c55d033 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -764,7 +764,8 @@ public: size_t WC2MB(char *buf, const wchar_t *psz, size_t n) { -#if defined(__BORLANDC__) && (__BORLANDC__ > 0x530) +#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) size_t inbuf = std::wcslen(psz); #else size_t inbuf = ::wcslen(psz); @@ -898,7 +899,8 @@ size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const return m_cset->WC2MB(buf, psz, n); // latin-1 (direct) -#if defined(__BORLANDC__) && (__BORLANDC__ > 0x530) +#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) size_t len=std::wcslen(psz); #else size_t len=::wcslen(psz); diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index 0a9261b912..3ff1adf9d1 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -60,6 +60,11 @@ # endif #endif +#if defined(__MWERKS__) && defined(__WXMSW__) +# undef HAVE_FTIME +# undef HAVE_GETTIMEOFDAY +#endif + #include #ifndef __WXMAC__ #include // for time_t diff --git a/src/jpeg/jmorecfg.h b/src/jpeg/jmorecfg.h index 2d86049094..342acc11f6 100644 --- a/src/jpeg/jmorecfg.h +++ b/src/jpeg/jmorecfg.h @@ -169,10 +169,11 @@ typedef short INT16; #ifdef XMD_H /* X11/xmd.h correctly defines INT32 */ #define INT32_DEFINED -#elif (_MSC_VER >= 1200) || (__BORLANDC__ >= 0x550) || \ - wxCHECK_W32API_VERSION( 0, 5 ) || \ - ((defined(__MINGW32__) || defined(__CYGWIN__)) \ - && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>95)))) +#elif (_MSC_VER >= 1200) || (__BORLANDC__ >= 0x550) \ + || wxCHECK_W32API_VERSION( 0, 5 ) \ + || ((defined(__MINGW32__) || defined(__CYGWIN__)) \ + && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>95)))) \ + || (defined(__MWERKS__) && defined(__WXMSW__)) /* INT32 is defined in windows.h for these compilers */ #define INT32_DEFINED @@ -263,6 +264,10 @@ typedef unsigned int JDIMENSION; #endif +#if (defined(__MWERKS__) && defined(__WXMSW__)) +#define HAVE_BOOLEAN +#endif + /* * On a few systems, type boolean and/or its values FALSE, TRUE may appear * in standard header files. Or you may have conflicts with application- diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index b8993a12c4..7d1870e9a2 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -468,7 +468,8 @@ STDMETHODIMP wxIDataObject::SetData(FORMATETC *pformatetc, break; #if !defined(__WATCOMC__) && ! (defined(__BORLANDC__) && (__BORLANDC__ < 0x500)) case CF_UNICODETEXT: -#if (defined(__BORLANDC__) && (__BORLANDC__ > 0x530)) +#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \ + || ( defined(__MWERKS__) && defined(__WXMSW__) ) size = std::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t); #else size = ::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t); diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 3c1a1b6532..afa81726ae 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -61,6 +61,17 @@ #include "wx/msw/dib.h" #include "wx/app.h" // for GetComCtl32Version +#if defined(__MWERKS__) && defined(__WXMSW__) +// including for max definition doesn't seem +// to work using CodeWarrior 6 Windows. So we define it +// here. (Otherwise we get a undefined identifier 'max' +// later on in this file.) (Added by dimitri@shortcut.nl) +# ifndef max +# define max(a,b) (((a) > (b)) ? (a) : (b)) +# endif + +#endif + // ---------------------------------------------------------------------------- // conditional compilation // ----------------------------------------------------------------------------