#ifndef _MINGW32_H
#define _MINGW32_H
+#include <_mingw.h>
+
/* The unicode support is activated by default starting with the 3.9 MingW
version. It is not possible to use it with previous version due to a bug
in the MingW runtime. */
#if (((__MINGW32_MAJOR_VERSION == 3 \
&& __MINGW32_MINOR_VERSION >= 9) \
- || (__MINGW32_MAJOR_VERSION >= 4)) \
+ || (__MINGW32_MAJOR_VERSION >= 4) \
+ || defined (__MINGW64)) \
&& !defined (RTX))
#define GNAT_UNICODE_SUPPORT
#define UNICODE /* For Win32 API */
#endif
+/* We need functionality available only starting with Windows XP */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
#include <tchar.h>
#include <windows.h>
#define WS2S(str,wstr,len) \
WideCharToMultiByte (CP_ACP,0,wstr,-1,str,len,NULL,NULL)
#else
+#define S2WSC(wstr,str,len) strncpy(wstr,str,len)
+#define WS2SC(str,wstr,len) strncpy(str,wstr,len)
#define S2WSU(wstr,str,len) strncpy(wstr,str,len)
#define WS2SU(str,wstr,len) strncpy(str,wstr,len)
#define S2WS(wstr,str,len) strncpy(wstr,str,len)