applied suggested fix for xhv_array sizing, with portability tweaks
[p5sagit/p5-mst-13.2.git] / win32 / perllib.c
index 8483606..3bec9c0 100644 (file)
@@ -9,12 +9,22 @@
 
 static void xs_init _((void));
 
-__declspec(dllexport) int
+DllExport int
 RunPerl(int argc, char **argv, char **env, void *iosubsystem)
 {
     int exitstatus;
     PerlInterpreter *my_perl;
 
+#ifdef PERL_GLOBAL_STRUCT
+#define PERLVAR(var,type) /**/
+#define PERLVARI(var,type,init) Perl_Vars.var = init;
+#define PERLVARIC(var,type,init) Perl_Vars.var = init;
+#include "perlvars.h"
+#undef PERLVAR
+#undef PERLVARI
+#undef PERLVARIC
+#endif
+
     PERL_SYS_INIT(&argc,&argv);
 
     perl_init_i18nl10n(1);
@@ -37,7 +47,7 @@ RunPerl(int argc, char **argv, char **env, void *iosubsystem)
     return (exitstatus);
 }
 
-extern HANDLE PerlDllHandle;
+extern HANDLE w32_perldll_handle;
 
 BOOL APIENTRY
 DllMain(HANDLE hModule,                /* DLL module handle */
@@ -56,7 +66,7 @@ DllMain(HANDLE hModule,               /* DLL module handle */
        setmode( fileno( stderr ), O_BINARY );
        _fmode = O_BINARY;
 #endif
-       PerlDllHandle = hModule;
+       w32_perldll_handle = hModule;
        break;
 
        /* The DLL is detaching from a process due to