From: Yitzchak Scott-Thoennes Date: Tue, 20 Feb 2007 01:50:18 +0000 (-0800) Subject: Re: Win32 modules & cygwin X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78ff2d7be71ff9f6811d8b05bb66c4c4707951ba;p=p5sagit%2Fp5-mst-13.2.git Re: Win32 modules & cygwin From: "Yitzchak Scott-Thoennes" Message-ID: <1254.67.42.109.122.1171965018.squirrel@67.42.109.122> Also includes integration & deletion of win32/ext/Win32API to ext/Win32API, and addition of copyright message and corrections to spacing/tabbing as suggested by Jan Dubois. p4raw-id: //depot/perl@30379 --- diff --git a/Configure b/Configure index fbfd228..bfbb788 100755 --- a/Configure +++ b/Configure @@ -21018,7 +21018,7 @@ find_extensions=' case "$xxx" in DynaLoader|dynaload) ;; *) - if $test -f $xxx/$xxx.xs; then + if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then known_extensions="$known_extensions $1$xxx"; elif $test -f $xxx/Makefile.PL; then nonxs_extensions="$nonxs_extensions $1$xxx"; @@ -21134,7 +21134,7 @@ for xxx in $known_extensions ; do esac esac ;; - Win32) + Win32*) case "$osname" in cygwin) avail_ext="$avail_ext $xxx" ;; esac diff --git a/MANIFEST b/MANIFEST index 82a0389..1240c41 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1215,6 +1215,23 @@ ext/util/make_ext Used by Makefile to execute extension Makefiles ext/Win32/Makefile.PL Win32 extension makefile writer ext/Win32/Win32.pm Win32 extension Perl module ext/Win32/Win32.xs Win32 extension external subroutines +ext/Win32API/File/buffers.h Win32API::File extension +ext/Win32API/File/cFile.h Win32API::File extension +ext/Win32API/File/cFile.pc Win32API::File extension +ext/Win32API/File/Changes Win32API::File extension changes +ext/Win32API/File/const2perl.h Win32API::File extension +ext/Win32API/File/ExtUtils/Myconst2perl.pm Win32API::File extension +ext/Win32API/File/File.pm Win32API::File extension +ext/Win32API/File/File.xs Win32API::File extension +ext/Win32API/File/Makefile.PL Win32API::File extension makefile write +ext/Win32API/File/README Win32API::File extension Readme +ext/Win32API/File/t/file.t See if Win32API::File extension works +ext/Win32API/File/t/tie.t See if Win32API::File extension works +ext/Win32API/File/typemap Win32API::File extension interface types +ext/Win32CORE/Makefile.PL Win32CORE extension +ext/Win32CORE/t/win32core.t Win32CORE extension +ext/Win32CORE/Win32CORE.c Win32CORE extension +ext/Win32CORE/Win32CORE.pm Win32CORE extension (stubs for Win32 CORE subs) ext/XS/APItest/APItest.pm XS::APItest extension ext/XS/APItest/APItest.xs XS::APItest extension ext/XS/APItest/core.c Test API functions when PERL_CORE is defined @@ -3832,19 +3849,6 @@ win32/config.vc Win32 base line config.sh (Visual C++ build) win32/config.vc64 Win64 base line config.sh (Visual C++ build) win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST win32/dl_win32.xs Win32 port -win32/ext/Win32API/File/buffers.h Win32API::File extension -win32/ext/Win32API/File/cFile.h Win32API::File extension -win32/ext/Win32API/File/cFile.pc Win32API::File extension -win32/ext/Win32API/File/Changes Win32API::File extension changes -win32/ext/Win32API/File/const2perl.h Win32API::File extension -win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm Win32API::File extension -win32/ext/Win32API/File/File.pm Win32API::File extension -win32/ext/Win32API/File/File.xs Win32API::File extension -win32/ext/Win32API/File/Makefile.PL Win32API::File extension makefile write -win32/ext/Win32API/File/README Win32API::File extension Readme -win32/ext/Win32API/File/t/file.t See if Win32API::File extension works -win32/ext/Win32API/File/t/tie.t See if Win32API::File extension works -win32/ext/Win32API/File/typemap Win32API::File extension interface types win32/fcrypt.c crypt() implementation win32/FindExt.pm Scan for extensions win32/genmk95.pl Perl code to generate command.com-usable makefile.95 diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 5f15632..508311c 100644 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -800,14 +800,14 @@ package Maintainers; 'win32' => { 'MAINTAINER' => 'jand', - 'FILES' => q[win32 README.win32 t/win32], + 'FILES' => q[win32 README.win32 t/win32 ext/Win32 ext/Win32CORE], 'CPAN' => 0, }, 'Win32API::File' => { 'MAINTAINER' => 'tyemq', - 'FILES' => q[win32/ext/Win32API/File], + 'FILES' => q[ext/Win32API/File], 'CPAN' => 1, }, diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index ec564f6..b774394 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -197,9 +197,16 @@ void init_os_extras(void) { char *file = __FILE__; + CV *cv; dTHX; newXS("Cwd::cwd", Cygwin_cwd, file); newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file); newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file); + + if ((cv = get_cv("Win32CORE::bootstrap", 0))) { + dSP; + PUSHMARK(SP); + (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID); + } } diff --git a/win32/ext/Win32API/File/Changes b/ext/Win32API/File/Changes similarity index 100% rename from win32/ext/Win32API/File/Changes rename to ext/Win32API/File/Changes diff --git a/win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm b/ext/Win32API/File/ExtUtils/Myconst2perl.pm similarity index 100% rename from win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm rename to ext/Win32API/File/ExtUtils/Myconst2perl.pm diff --git a/win32/ext/Win32API/File/File.pm b/ext/Win32API/File/File.pm similarity index 100% rename from win32/ext/Win32API/File/File.pm rename to ext/Win32API/File/File.pm diff --git a/win32/ext/Win32API/File/File.xs b/ext/Win32API/File/File.xs similarity index 100% rename from win32/ext/Win32API/File/File.xs rename to ext/Win32API/File/File.xs diff --git a/win32/ext/Win32API/File/Makefile.PL b/ext/Win32API/File/Makefile.PL similarity index 100% rename from win32/ext/Win32API/File/Makefile.PL rename to ext/Win32API/File/Makefile.PL diff --git a/win32/ext/Win32API/File/README b/ext/Win32API/File/README similarity index 100% rename from win32/ext/Win32API/File/README rename to ext/Win32API/File/README diff --git a/win32/ext/Win32API/File/buffers.h b/ext/Win32API/File/buffers.h similarity index 100% rename from win32/ext/Win32API/File/buffers.h rename to ext/Win32API/File/buffers.h diff --git a/win32/ext/Win32API/File/cFile.h b/ext/Win32API/File/cFile.h similarity index 100% rename from win32/ext/Win32API/File/cFile.h rename to ext/Win32API/File/cFile.h diff --git a/win32/ext/Win32API/File/cFile.pc b/ext/Win32API/File/cFile.pc similarity index 100% rename from win32/ext/Win32API/File/cFile.pc rename to ext/Win32API/File/cFile.pc diff --git a/win32/ext/Win32API/File/const2perl.h b/ext/Win32API/File/const2perl.h similarity index 100% rename from win32/ext/Win32API/File/const2perl.h rename to ext/Win32API/File/const2perl.h diff --git a/win32/ext/Win32API/File/t/file.t b/ext/Win32API/File/t/file.t similarity index 99% rename from win32/ext/Win32API/File/t/file.t rename to ext/Win32API/File/t/file.t index f7f16c5..27cfc28 100644 --- a/win32/ext/Win32API/File/t/file.t +++ b/ext/Win32API/File/t/file.t @@ -233,7 +233,12 @@ $ok= ! DeleteFile( "Moved.cp" ) $ok or print "# ",fileLastError(),"\n"; print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 35 -system( "attrib -r Moved.cp" ); +if ($^O eq 'cygwin') { + chmod( 0200 | 07777 & (stat("Moved.cp"))[2], "Moved.cp" ); +} +else { + system( "attrib -r Moved.cp" ); +} $ok= DeleteFile( "Moved.cp" ); $ok or print "# ",fileLastError(),"\n"; diff --git a/win32/ext/Win32API/File/t/tie.t b/ext/Win32API/File/t/tie.t similarity index 100% rename from win32/ext/Win32API/File/t/tie.t rename to ext/Win32API/File/t/tie.t diff --git a/win32/ext/Win32API/File/typemap b/ext/Win32API/File/typemap similarity index 100% rename from win32/ext/Win32API/File/typemap rename to ext/Win32API/File/typemap diff --git a/ext/Win32CORE/Makefile.PL b/ext/Win32CORE/Makefile.PL new file mode 100644 index 0000000..0fec306 --- /dev/null +++ b/ext/Win32CORE/Makefile.PL @@ -0,0 +1,6 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'Win32CORE', + 'VERSION_FROM' => 'Win32CORE.pm', +); diff --git a/ext/Win32CORE/Win32CORE.c b/ext/Win32CORE/Win32CORE.c new file mode 100644 index 0000000..8a56c3e --- /dev/null +++ b/ext/Win32CORE/Win32CORE.c @@ -0,0 +1,82 @@ +/* Win32CORE.c + * + * Copyright (C) 2007 by Larry Wall and others + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ + +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +static void +forward(pTHX_ const char *function) +{ + dXSARGS; + Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27)); + SPAGAIN; + PUSHMARK(SP-items); + call_pv(function, GIMME_V); +} + +#define FORWARD(function) XS(w32_##function){ forward(aTHX_ "Win32::"#function); } +FORWARD(GetCwd) +FORWARD(SetCwd) +FORWARD(GetNextAvailDrive) +FORWARD(GetLastError) +FORWARD(SetLastError) +FORWARD(LoginName) +FORWARD(NodeName) +FORWARD(DomainName) +FORWARD(FsType) +FORWARD(GetOSVersion) +FORWARD(IsWinNT) +FORWARD(IsWin95) +FORWARD(FormatMessage) +FORWARD(Spawn) +FORWARD(GetTickCount) +FORWARD(GetShortPathName) +FORWARD(GetFullPathName) +FORWARD(GetLongPathName) +FORWARD(CopyFile) +FORWARD(Sleep) + +/* Don't forward Win32::SetChildShowWindow(). It accesses the internal variable + * w32_showwindow in thread_intern and is therefore not implemented in Win32.xs. + */ +/* FORWARD(SetChildShowWindow) */ + +#undef FORWARD + +XS(boot_Win32CORE) +{ + dXSARGS; + char *file = __FILE__; + + /* these names are Activeware compatible */ + newXS("Win32::GetCwd", w32_GetCwd, file); + newXS("Win32::SetCwd", w32_SetCwd, file); + newXS("Win32::GetNextAvailDrive", w32_GetNextAvailDrive, file); + newXS("Win32::GetLastError", w32_GetLastError, file); + newXS("Win32::SetLastError", w32_SetLastError, file); + newXS("Win32::LoginName", w32_LoginName, file); + newXS("Win32::NodeName", w32_NodeName, file); + newXS("Win32::DomainName", w32_DomainName, file); + newXS("Win32::FsType", w32_FsType, file); + newXS("Win32::GetOSVersion", w32_GetOSVersion, file); + newXS("Win32::IsWinNT", w32_IsWinNT, file); + newXS("Win32::IsWin95", w32_IsWin95, file); + newXS("Win32::FormatMessage", w32_FormatMessage, file); + newXS("Win32::Spawn", w32_Spawn, file); + newXS("Win32::GetTickCount", w32_GetTickCount, file); + newXS("Win32::GetShortPathName", w32_GetShortPathName, file); + newXS("Win32::GetFullPathName", w32_GetFullPathName, file); + newXS("Win32::GetLongPathName", w32_GetLongPathName, file); + newXS("Win32::CopyFile", w32_CopyFile, file); + newXS("Win32::Sleep", w32_Sleep, file); + /* newXS("Win32::SetChildShowWindow", w32_SetChildShowWindow, file); */ + + XSRETURN_YES; +} diff --git a/ext/Win32CORE/Win32CORE.pm b/ext/Win32CORE/Win32CORE.pm new file mode 100644 index 0000000..979dd84 --- /dev/null +++ b/ext/Win32CORE/Win32CORE.pm @@ -0,0 +1,26 @@ +package Win32CORE; + +$VERSION = '0.01'; + +use strict; +use warnings; +use vars qw($VERSION @ISA); +use base qw(Exporter DynaLoader); +no warnings "redefine"; + +bootstrap Win32CORE $VERSION; + +1; +__END__ +=head1 NAME + +Win32CORE - Win32 CORE functions + +=head1 DESCRIPTION + +This library provides the functions marked as [CORE] in L. See that +document for usage information. In cygwin, as of 5.8.6 it is no longer +necessary to use this module; the functions should be available even without +C or C<-MWin32CORE>. + +=cut diff --git a/ext/Win32CORE/t/win32core.t b/ext/Win32CORE/t/win32core.t new file mode 100644 index 0000000..2231530 --- /dev/null +++ b/ext/Win32CORE/t/win32core.t @@ -0,0 +1,6 @@ +#!perl + +use Test; +BEGIN { plan tests => 1 }; +use Win32CORE; +ok(1); diff --git a/hints/cygwin.sh b/hints/cygwin.sh index f88e7c5..e0cdc05 100644 --- a/hints/cygwin.sh +++ b/hints/cygwin.sh @@ -50,6 +50,9 @@ case "$osvers" in ;; esac; +# compile Win32CORE "module" as static +static_ext="$static_ext Win32CORE" + # Win9x problem with non-blocking read from a closed pipe d_eofnblk='define' diff --git a/mkppport.lst b/mkppport.lst index 548ae2b..1dd21df 100644 --- a/mkppport.lst +++ b/mkppport.lst @@ -11,5 +11,4 @@ ext/Data/Dumper ext/Digest/SHA ext/Sys/Syslog ext/Time/HiRes - -win32/ext/Win32API/File +ext/Win32API/File diff --git a/win32/FindExt.pm b/win32/FindExt.pm index eb0eb3b..f0477b8 100644 --- a/win32/FindExt.pm +++ b/win32/FindExt.pm @@ -82,7 +82,7 @@ sub find_ext closedir $dh; for my $xxx (@items) { if ($xxx ne "DynaLoader") { - if (-f "$xxx/$xxx.xs") { + if (-f "$xxx/$xxx.xs" || -f "$xxx/$xxx.c" ) { $ext{"$_[0]$xxx"} = $static{"$_[0]$xxx"} ? 'static' : 'dynamic'; } elsif (-f "$xxx/Makefile.PL") { $ext{"$_[0]$xxx"} = 'nonxs'; diff --git a/win32/Makefile b/win32/Makefile index 8299d1c..71b99c3 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -771,7 +771,7 @@ SETARGV_OBJ = setargv$(o) # specify static extensions here #STATIC_EXT = Cwd Compress/Raw/Zlib -STATIC_EXT = +STATIC_EXT = Win32CORE DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader @@ -1005,26 +1005,26 @@ MakePPPort_clean: Extensions: buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic Extensions_reonly: buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic +re - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re Extensions_static : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static $(MINIPERL) -I..\lib buildext.pl --list-static-libs > Extensions_static Extensions_clean: -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean + -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean Extensions_realclean: -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean + -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean #------------------------------------------------------------------------------- diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 884db4a..98c01eb 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -43,7 +43,7 @@ while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) { } FindExt::scan_ext("../ext"); -FindExt::scan_ext("ext"); +FindExt::scan_ext("ext") if -d 'ext'; # also look in win32/ext/ if it exists FindExt::set_static_extensions(split ' ', $opt{'static_ext'}); my @dynamic_ext = grep(!/Thread/,FindExt::dynamic_ext()); diff --git a/win32/makefile.mk b/win32/makefile.mk index 7b6a1d3..aba1945 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -938,7 +938,7 @@ SETARGV_OBJ = setargv$(o) # specify static extensions here #STATIC_EXT = Cwd Compress/Raw/Zlib -STATIC_EXT = +STATIC_EXT = Win32CORE DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader @@ -1336,26 +1336,26 @@ MakePPPort_clean: Extensions : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic Extensions_reonly : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic +re - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re Extensions_static : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static - $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static + -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static $(MINIPERL) -I..\lib buildext.pl --list-static-libs > Extensions_static Extensions_clean : -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean + -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean Extensions_realclean : -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean + -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean #------------------------------------------------------------------------------- diff --git a/win32/win32.c b/win32/win32.c index cbd3a36..aacc656 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4561,73 +4561,21 @@ XS(w32_SetChildShowWindow) XSRETURN(1); } -static void -forward(pTHX_ const char *function) -{ - dXSARGS; - Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27)); - SPAGAIN; - PUSHMARK(SP-items); - call_pv(function, GIMME_V); -} - -#define FORWARD(function) XS(w32_##function){ forward(aTHX_ "Win32::"#function); } -FORWARD(GetCwd) -FORWARD(SetCwd) -FORWARD(GetNextAvailDrive) -FORWARD(GetLastError) -FORWARD(SetLastError) -FORWARD(LoginName) -FORWARD(NodeName) -FORWARD(DomainName) -FORWARD(FsType) -FORWARD(GetOSVersion) -FORWARD(IsWinNT) -FORWARD(IsWin95) -FORWARD(FormatMessage) -FORWARD(Spawn) -FORWARD(GetTickCount) -FORWARD(GetShortPathName) -FORWARD(GetFullPathName) -FORWARD(GetLongPathName) -FORWARD(CopyFile) -FORWARD(Sleep) - -/* Don't forward Win32::SetChildShowWindow(). It accesses the internal variable - * w32_showwindow in thread_intern and is therefore not implemented in Win32.xs. - */ -/* FORWARD(SetChildShowWindow) */ - -#undef FORWARD - void Perl_init_os_extras(void) { dTHX; char *file = __FILE__; + CV *cv; dXSUB_SYS; - /* these names are Activeware compatible */ - newXS("Win32::GetCwd", w32_GetCwd, file); - newXS("Win32::SetCwd", w32_SetCwd, file); - newXS("Win32::GetNextAvailDrive", w32_GetNextAvailDrive, file); - newXS("Win32::GetLastError", w32_GetLastError, file); - newXS("Win32::SetLastError", w32_SetLastError, file); - newXS("Win32::LoginName", w32_LoginName, file); - newXS("Win32::NodeName", w32_NodeName, file); - newXS("Win32::DomainName", w32_DomainName, file); - newXS("Win32::FsType", w32_FsType, file); - newXS("Win32::GetOSVersion", w32_GetOSVersion, file); - newXS("Win32::IsWinNT", w32_IsWinNT, file); - newXS("Win32::IsWin95", w32_IsWin95, file); - newXS("Win32::FormatMessage", w32_FormatMessage, file); - newXS("Win32::Spawn", w32_Spawn, file); - newXS("Win32::GetTickCount", w32_GetTickCount, file); - newXS("Win32::GetShortPathName", w32_GetShortPathName, file); - newXS("Win32::GetFullPathName", w32_GetFullPathName, file); - newXS("Win32::GetLongPathName", w32_GetLongPathName, file); - newXS("Win32::CopyFile", w32_CopyFile, file); - newXS("Win32::Sleep", w32_Sleep, file); + /* load Win32 CORE stubs, assuming Win32CORE was statically linked */ + if ((cv = get_cv("Win32CORE::bootstrap", 0))) { + dSP; + PUSHMARK(SP); + (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID); + } + newXS("Win32::SetChildShowWindow", w32_SetChildShowWindow, file); }