This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make DynaLoader clone its private data under threads.
[perl5.git] / win32 / win32.h
index 893a66b..7b9c8d0 100644 (file)
@@ -127,8 +127,11 @@ struct utsname {
 /* 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
 
@@ -167,6 +170,14 @@ struct utsname {
 
 /* 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)
@@ -182,14 +193,15 @@ struct utsname {
 #define DllMain DllEntryPoint
 #endif
 
-#pragma warn -ccc      /* "condition is always true/false" */
-#pragma warn -rch      /* "unreachable code" */
-#pragma warn -sig      /* "conversion may lose significant digits" */
-#pragma warn -pia      /* "possibly incorrect assignment" */
-#pragma warn -par      /* "parameter 'foo' is never used" */
-#pragma warn -aus      /* "'foo' is assigned a value that is never used" */
-#pragma warn -use      /* "'foo' is declared but never used" */
-#pragma warn -csu      /* "comparing signed and unsigned values" */
+#pragma warn -8004     /* "'foo' is assigned a value that is never used" */
+#pragma warn -8008     /* "condition is always true/false" */
+#pragma warn -8012     /* "comparing signed and unsigned values" */
+#pragma warn -8027     /* "functions containing %s are not expanded inline" */
+#pragma warn -8057     /* "parameter 'foo' is never used" */
+#pragma warn -8060     /* "possibly incorrect assignment" */
+#pragma warn -8066     /* "unreachable code" */
+#pragma warn -8071     /* "conversion may lose significant digits" */
+#pragma warn -8080     /* "'foo' is declared but never used" */
 
 /* Borland C thinks that a pointer to a member variable is 12 bytes in size. */
 #define PERL_MEMBER_PTR_SIZE   12
@@ -281,6 +293,7 @@ extern  gid_t       getegid(void);
 extern  int    setuid(uid_t uid);
 extern  int    setgid(gid_t gid);
 extern  int    kill(int pid, int sig);
+extern  int    killpg(int pid, int sig);
 #ifndef USE_PERL_SBRK
 extern  void   *sbrk(ptrdiff_t need);
 #  define HAS_SBRK_PROTO
@@ -332,12 +345,11 @@ extern FILE *             my_fdopen(int, char *);
 #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);
@@ -361,10 +373,6 @@ typedef  char *            caddr_t;        /* In malloc.c (core address). */
 /* #define PERL_SBRK_VIA_MALLOC        /**/
 #endif
 
-#if defined(PERLDLL) && !defined(PERL_CORE)
-#define PERL_CORE
-#endif
-
 #ifdef PERL_TEXTMODE_SCRIPTS
 #  define PERL_SCRIPT_MODE             "r"
 #else