/* WIN32.H
*
* (c) 1995 Microsoft Corporation. All rights reserved.
- * Developed by hip communications inc., http://info.hip.com/info/
+ * Developed by hip communications inc.
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+/*
+ * Bug in winbase.h in mingw-w64 4.4.0-1 at least... they
+ * do #define GetEnvironmentStringsA GetEnvironmentStrings and fail
+ * to declare GetEnvironmentStringsA.
+ */
+#if defined(__MINGW64__) && defined(GetEnvironmentStringsA) && !defined(UNICODE)
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef GetEnvironmentStringsA
+WINBASEAPI LPCH WINAPI GetEnvironmentStringsA(VOID);
+#define GetEnvironmentStrings GetEnvironmentStringsA
+#ifdef __cplusplus
+}
+#endif
+#endif
+
#ifdef WIN32_LEAN_AND_MEAN /* C file is NOT a Perl5 original. */
#define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */
#endif /*WIN32_LEAN_AND_MEAN */
/* Define USE_FIXED_OSFHANDLE to fix MSVCRT's _open_osfhandle() on W95.
It now uses some black magic to work seamlessly with the DLL CRT and
works with MSVC++ 4.0+ or GCC/Mingw32
- -- BKS 1-24-2000 */
-#if (defined(_M_IX86) && _MSC_VER >= 1000) || defined(__MINGW32__)
+ -- BKS 1-24-2000
+ Only use this fix for VC++ 6.x or earlier (and for GCC, which we assume
+ uses MSVCRT.DLL). Later versions use MSVCR70.dll, MSVCR71.dll, etc, which
+ do not require the fix. */
+#if (defined(_M_IX86) && _MSC_VER >= 1000 && _MSC_VER <= 1200) || defined(__MINGW32__)
#define USE_FIXED_OSFHANDLE
#endif
/* Compiler-specific stuff. */
+#if defined(_MSC_VER) || defined(__MINGW32__)
+/* VC uses non-standard way to determine the size and alignment if bit-fields */
+/* MinGW will compiler with -mms-bitfields, so should use the same types */
+# define PERL_BITFIELD8 unsigned char
+# define PERL_BITFIELD16 unsigned short
+# define PERL_BITFIELD32 unsigned int
+#endif
+
#ifdef __BORLANDC__ /* Borland C++ */
#if (__BORLANDC__ <= 0x520)
#endif
extern int my_fclose(FILE *);
extern int my_fstat(int fd, Stat_t *sbufptr);
-extern char * win32_get_privlib(const char *pl);
-extern char * win32_get_sitelib(const char *pl);
-extern char * win32_get_vendorlib(const char *pl);
+extern char * win32_get_privlib(const char *pl, STRLEN *const len);
+extern char * win32_get_sitelib(const char *pl, STRLEN *const len);
+extern char * win32_get_vendorlib(const char *pl, STRLEN *const len);
extern int IsWin95(void);
extern int IsWinNT(void);
-extern void win32_argv2utf8(int argc, char** argv);
#ifdef PERL_IMPLICIT_SYS
extern void win32_delete_internal_host(void *h);