// ----------------------------------------------------------------------------
// 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
#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>
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;
#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
#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"