From 7f017c64bbad70dac236202cf208889f08f75a8c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Jun 2001 20:32:09 +0000 Subject: [PATCH] applied patch 430452 (mingw32 compilation fixes) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 2 +- include/wx/wxchar.h | 3 ++- src/common/string.cpp | 3 ++- src/msw/ole/droptgt.cpp | 3 +++ src/msw/ole/uuid.cpp | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 7543d8ca03..85931defeb 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -66,7 +66,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; // ---------------------------------------------------------------------------- // Microsoft compiler loves underscores, feed them to it -#if defined( __VISUALC__ ) || defined( __GNUWIN32__ ) +#if defined( __VISUALC__ ) || wxCHECK_W32API_VERSION( 0, 5 ) // functions #define wxClose _close #define wxRead _read diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index f8ec9c0d0f..9571f20b2e 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -63,7 +63,8 @@ #define wxHAVE_TCHAR_FUNCTIONS #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) #define wxHAVE_TCHAR_FUNCTIONS - #elif defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 0, 6 ) + // w32api isn't yet tchar safe, will be soon, this is a placeholder + #elif defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 10, 0 ) #define wxHAVE_TCHAR_FUNCTIONS #include #include diff --git a/src/common/string.cpp b/src/common/string.cpp index b0550b816f..917bd82d09 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -201,7 +201,8 @@ extern int WXDLLEXPORT wxVsnprintf(wxChar *buf, size_t len, int iLen = s.PrintfV(format, argptr); if ( iLen != -1 ) { - wxStrncpy(buf, s.c_str(), iLen); + wxStrncpy(buf, s.c_str(), len); + buf[len-1] = wxT('\0'); } return iLen; diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index aeb5185577..57d4cb04e8 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -36,6 +36,9 @@ #ifdef __WIN32__ #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS + #if wxCHECK_W32API_VERSION( 1, 0 ) + #include + #endif #include // for DROPFILES structure #endif #else diff --git a/src/msw/ole/uuid.cpp b/src/msw/ole/uuid.cpp index 9436536733..c23c4ca414 100644 --- a/src/msw/ole/uuid.cpp +++ b/src/msw/ole/uuid.cpp @@ -29,6 +29,9 @@ #if wxUSE_DRAG_AND_DROP // standard headers +#if wxCHECK_W32API_VERSION( 1, 0 ) + #include +#endif #include // UUID related functions #include "wx/msw/ole/uuid.h" -- 2.45.2