]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch 430452 (mingw32 compilation fixes)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Jun 2001 20:32:09 +0000 (20:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Jun 2001 20:32:09 +0000 (20:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/filefn.h
include/wx/wxchar.h
src/common/string.cpp
src/msw/ole/droptgt.cpp
src/msw/ole/uuid.cpp

index 7543d8ca0312f54f907257161e1f6f9b86175c68..85931defeb5716fd82705f9ac1dec5961fe2c1e4 100644 (file)
@@ -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
index f8ec9c0d0fd999bd2b20fd51f747d7af3f47719f..9571f20b2eef19d7a9caa455869b9b1e15390148 100644 (file)
@@ -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 <stddef.h>
         #include <string.h>
index b0550b816fad8a71448fc03e6b9800f68c040949..917bd82d09feccadba04db285dc0919c063f0b37 100644 (file)
@@ -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;
index aeb5185577b9b1365adf2cd93960f90697ee18dc..57d4cb04e823dd2c3dcdb690f71de4f02156bafd 100644 (file)
@@ -36,6 +36,9 @@
 
 #ifdef __WIN32__
     #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS
+        #if wxCHECK_W32API_VERSION( 1, 0 )
+            #include <windows.h>
+        #endif
         #include <shlobj.h>            // for DROPFILES structure
     #endif
 #else
index 9436536733a3b54294b92c2d02f25fe25be4c688..c23c4ca414bc3a95770f747af4555025fa564b62 100644 (file)
@@ -29,6 +29,9 @@
 #if wxUSE_DRAG_AND_DROP
 
 // standard headers
+#if wxCHECK_W32API_VERSION( 1, 0 )
+    #include <windows.h>
+#endif
 #include  <rpc.h>                       // UUID related functions
 
 #include  "wx/msw/ole/uuid.h"