X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fperllib.c;h=5bd7ee83d7dcbde1c9bf8eaaf8bb4c75805669e0;hb=dafda6d147bb18b3050b636ac1d31818028dd936;hp=6243a79fd3d4ea21dfdc6168db79de7924a3df44;hpb=acfe0abcedaf592fb4b9cb69ce3468308ae99d91;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/perllib.c b/win32/perllib.c index 6243a79..5bd7ee8 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -16,10 +16,20 @@ /* Register any extra external extensions */ char *staticlinkmodules[] = { "DynaLoader", + /* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC1 +#include "perllibst.h" +#endif NULL, }; EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); +/* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC2 +#include "perllibst.h" +#endif static void xs_init(pTHX) @@ -27,12 +37,28 @@ xs_init(pTHX) char *file = __FILE__; dXSUB_SYS; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); + /* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC3 +#include "perllibst.h" +#endif } #ifdef PERL_IMPLICIT_SYS #include "perlhost.h" +void +win32_checkTLS(PerlInterpreter *host_perl) +{ + dTHX; + if (host_perl != my_perl) { + int *nowhere = NULL; + *nowhere = 0; + abort(); + } +} + EXTERN_C void perl_get_host_info(struct IPerlMemInfo* perlMemInfo, struct IPerlMemInfo* perlMemSharedInfo, @@ -105,6 +131,7 @@ perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared, pHost->m_pHostperlProc); if (my_perl) { w32_internal_host = pHost; + pHost->host_perl = my_perl; } } return my_perl; @@ -127,6 +154,7 @@ perl_alloc(void) pHost->m_pHostperlProc); if (my_perl) { w32_internal_host = pHost; + pHost->host_perl = my_perl; } } return my_perl; @@ -154,7 +182,6 @@ RunPerl(int argc, char **argv, char **env) * want to free() argv after main() returns. As luck would have it, * Borland's CRT does the right thing to argv[0] already. */ char szModuleName[MAX_PATH]; - char *ptr; GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); (void)win32_longpath(szModuleName); @@ -249,7 +276,7 @@ DllMain(HANDLE hModule, /* DLL module handle */ PerlIO_cleanup() was done here but fails (B). */ EndSockets(); -#if defined(USE_5005THREADS) || defined(USE_ITHREADS) +#if defined(USE_ITHREADS) if (PL_curinterp) FREE_THREAD_KEY; #endif @@ -287,6 +314,7 @@ perl_clone_host(PerlInterpreter* proto_perl, UV flags) { h->m_pHostperlProc ); proto_perl->Isys_intern.internal_host = h; + h->host_perl = proto_perl; return proto_perl; }