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
This commit is contained in:
Vadim Zeitlin 2001-10-23 20:43:23 +00:00
parent 2c37aade57
commit de85a884d7
9 changed files with 43 additions and 9 deletions

View File

@ -71,7 +71,8 @@ public:
wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") ); wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
if (wcs) { 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); size_t siz = (std::wcslen(wcs)+1)*sizeof(wchar_t);
#else #else
size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t); size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t);

View File

@ -66,7 +66,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Microsoft compiler loves underscores, feed them to it // 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 // functions
#define wxClose _close #define wxClose _close
#define wxRead _read #define wxRead _read

View File

@ -88,6 +88,9 @@
#ifndef __MWERKS__ #ifndef __MWERKS__
#include <sys/types.h> // needed for stat #include <sys/types.h> // needed for stat
#include <sys/stat.h> // stat #include <sys/stat.h> // stat
#elif ( defined(__MWERKS__) && defined(__WXMSW__) )
#include <sys/types.h> // needed for stat
#include <sys/stat.h> // stat
#endif #endif
#if defined(__BORLANDC__) || defined(_MSC_VER) #if defined(__BORLANDC__) || defined(_MSC_VER)

View File

@ -28,7 +28,12 @@
#if wxUSE_LONGLONG #if wxUSE_LONGLONG
#include "wx/longlong.h" #include "wx/longlong.h"
#if defined(__MWERKS__) && defined(__WXMSW__)
#include <string.h> // for memset()
#else
#include <memory.h> // for memset() #include <memory.h> // for memset()
#endif
#include <math.h> // for fabs() #include <math.h> // for fabs()
// ============================================================================ // ============================================================================

View File

@ -764,7 +764,8 @@ public:
size_t WC2MB(char *buf, const wchar_t *psz, size_t n) 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); size_t inbuf = std::wcslen(psz);
#else #else
size_t inbuf = ::wcslen(psz); 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); return m_cset->WC2MB(buf, psz, n);
// latin-1 (direct) // latin-1 (direct)
#if defined(__BORLANDC__) && (__BORLANDC__ > 0x530) #if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \
|| ( defined(__MWERKS__) && defined(__WXMSW__) )
size_t len=std::wcslen(psz); size_t len=std::wcslen(psz);
#else #else
size_t len=::wcslen(psz); size_t len=::wcslen(psz);

View File

@ -60,6 +60,11 @@
# endif # endif
#endif #endif
#if defined(__MWERKS__) && defined(__WXMSW__)
# undef HAVE_FTIME
# undef HAVE_GETTIMEOFDAY
#endif
#include <time.h> #include <time.h>
#ifndef __WXMAC__ #ifndef __WXMAC__
#include <sys/types.h> // for time_t #include <sys/types.h> // for time_t

View File

@ -169,10 +169,11 @@ typedef short INT16;
#ifdef XMD_H #ifdef XMD_H
/* X11/xmd.h correctly defines INT32 */ /* X11/xmd.h correctly defines INT32 */
#define INT32_DEFINED #define INT32_DEFINED
#elif (_MSC_VER >= 1200) || (__BORLANDC__ >= 0x550) || \ #elif (_MSC_VER >= 1200) || (__BORLANDC__ >= 0x550) \
wxCHECK_W32API_VERSION( 0, 5 ) || \ || wxCHECK_W32API_VERSION( 0, 5 ) \
((defined(__MINGW32__) || defined(__CYGWIN__)) \ || ((defined(__MINGW32__) || defined(__CYGWIN__)) \
&& ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>95)))) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>95)))) \
|| (defined(__MWERKS__) && defined(__WXMSW__))
/* INT32 is defined in windows.h for these compilers */ /* INT32 is defined in windows.h for these compilers */
#define INT32_DEFINED #define INT32_DEFINED
@ -263,6 +264,10 @@ typedef unsigned int JDIMENSION;
#endif #endif
#if (defined(__MWERKS__) && defined(__WXMSW__))
#define HAVE_BOOLEAN
#endif
/* /*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear * 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- * in standard header files. Or you may have conflicts with application-

View File

@ -468,7 +468,8 @@ STDMETHODIMP wxIDataObject::SetData(FORMATETC *pformatetc,
break; break;
#if !defined(__WATCOMC__) && ! (defined(__BORLANDC__) && (__BORLANDC__ < 0x500)) #if !defined(__WATCOMC__) && ! (defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
case CF_UNICODETEXT: 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); size = std::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t);
#else #else
size = ::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t); size = ::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t);

View File

@ -61,6 +61,17 @@
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#include "wx/app.h" // for GetComCtl32Version #include "wx/app.h" // for GetComCtl32Version
#if defined(__MWERKS__) && defined(__WXMSW__)
// including <windef.h> 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 // conditional compilation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------