diff options
-rwxr-xr-x | Configure | 4 | ||||
-rw-r--r-- | MANIFEST | 30 | ||||
-rw-r--r-- | Porting/Maintainers.pl | 4 | ||||
-rw-r--r-- | cygwin/cygwin.c | 7 | ||||
-rw-r--r-- | ext/Win32API/File/Changes (renamed from win32/ext/Win32API/File/Changes) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/ExtUtils/Myconst2perl.pm (renamed from win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/File.pm (renamed from win32/ext/Win32API/File/File.pm) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/File.xs (renamed from win32/ext/Win32API/File/File.xs) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/Makefile.PL (renamed from win32/ext/Win32API/File/Makefile.PL) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/README (renamed from win32/ext/Win32API/File/README) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/buffers.h (renamed from win32/ext/Win32API/File/buffers.h) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/cFile.h (renamed from win32/ext/Win32API/File/cFile.h) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/cFile.pc (renamed from win32/ext/Win32API/File/cFile.pc) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/const2perl.h (renamed from win32/ext/Win32API/File/const2perl.h) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/t/file.t (renamed from win32/ext/Win32API/File/t/file.t) | 7 | ||||
-rw-r--r-- | ext/Win32API/File/t/tie.t (renamed from win32/ext/Win32API/File/t/tie.t) | 0 | ||||
-rw-r--r-- | ext/Win32API/File/typemap (renamed from win32/ext/Win32API/File/typemap) | 0 | ||||
-rw-r--r-- | ext/Win32CORE/Makefile.PL | 6 | ||||
-rw-r--r-- | ext/Win32CORE/Win32CORE.c | 82 | ||||
-rw-r--r-- | ext/Win32CORE/Win32CORE.pm | 26 | ||||
-rw-r--r-- | ext/Win32CORE/t/win32core.t | 6 | ||||
-rw-r--r-- | hints/cygwin.sh | 3 | ||||
-rw-r--r-- | mkppport.lst | 3 | ||||
-rw-r--r-- | win32/FindExt.pm | 2 | ||||
-rw-r--r-- | win32/Makefile | 12 | ||||
-rw-r--r-- | win32/config_sh.PL | 2 | ||||
-rw-r--r-- | win32/makefile.mk | 12 | ||||
-rw-r--r-- | win32/win32.c | 68 |
28 files changed, 180 insertions, 94 deletions
@@ -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 @@ -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 5f15632780..508311c0de 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 ec564f68cf..b774394c7c 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 index b63b2763da..b63b2763da 100644 --- a/win32/ext/Win32API/File/Changes +++ b/ext/Win32API/File/Changes diff --git a/win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm b/ext/Win32API/File/ExtUtils/Myconst2perl.pm index d4f936e107..d4f936e107 100644 --- a/win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm +++ b/ext/Win32API/File/ExtUtils/Myconst2perl.pm diff --git a/win32/ext/Win32API/File/File.pm b/ext/Win32API/File/File.pm index 74494fa7ec..74494fa7ec 100644 --- a/win32/ext/Win32API/File/File.pm +++ b/ext/Win32API/File/File.pm diff --git a/win32/ext/Win32API/File/File.xs b/ext/Win32API/File/File.xs index 7dbe783c0e..7dbe783c0e 100644 --- a/win32/ext/Win32API/File/File.xs +++ b/ext/Win32API/File/File.xs diff --git a/win32/ext/Win32API/File/Makefile.PL b/ext/Win32API/File/Makefile.PL index c84d1de4cd..c84d1de4cd 100644 --- a/win32/ext/Win32API/File/Makefile.PL +++ b/ext/Win32API/File/Makefile.PL diff --git a/win32/ext/Win32API/File/README b/ext/Win32API/File/README index c460844d4d..c460844d4d 100644 --- a/win32/ext/Win32API/File/README +++ b/ext/Win32API/File/README diff --git a/win32/ext/Win32API/File/buffers.h b/ext/Win32API/File/buffers.h index 2ae74e690b..2ae74e690b 100644 --- a/win32/ext/Win32API/File/buffers.h +++ b/ext/Win32API/File/buffers.h diff --git a/win32/ext/Win32API/File/cFile.h b/ext/Win32API/File/cFile.h index 23e7ed89f5..23e7ed89f5 100644 --- a/win32/ext/Win32API/File/cFile.h +++ b/ext/Win32API/File/cFile.h diff --git a/win32/ext/Win32API/File/cFile.pc b/ext/Win32API/File/cFile.pc index da00f413aa..da00f413aa 100644 --- a/win32/ext/Win32API/File/cFile.pc +++ b/ext/Win32API/File/cFile.pc diff --git a/win32/ext/Win32API/File/const2perl.h b/ext/Win32API/File/const2perl.h index dbd94c10a8..dbd94c10a8 100644 --- a/win32/ext/Win32API/File/const2perl.h +++ b/ext/Win32API/File/const2perl.h diff --git a/win32/ext/Win32API/File/t/file.t b/ext/Win32API/File/t/file.t index f7f16c5744..27cfc28225 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 index ec2f7c2cf9..ec2f7c2cf9 100644 --- a/win32/ext/Win32API/File/t/tie.t +++ b/ext/Win32API/File/t/tie.t diff --git a/win32/ext/Win32API/File/typemap b/ext/Win32API/File/typemap index d5957652f9..d5957652f9 100644 --- a/win32/ext/Win32API/File/typemap +++ b/ext/Win32API/File/typemap diff --git a/ext/Win32CORE/Makefile.PL b/ext/Win32CORE/Makefile.PL new file mode 100644 index 0000000000..0fec3061be --- /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 0000000000..8a56c3e21a --- /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 0000000000..979dd84644 --- /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<Win32>. 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<use Win32CORE;> or C<-MWin32CORE>. + +=cut diff --git a/ext/Win32CORE/t/win32core.t b/ext/Win32CORE/t/win32core.t new file mode 100644 index 0000000000..2231530bdf --- /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 f88e7c5fea..e0cdc05858 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 548ae2b539..1dd21dfbc4 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 eb0eb3b662..f0477b8846 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 8299d1c9fa..71b99c3af8 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 884db4a537..98c01eb3c9 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 7b6a1d35c9..aba1945e11 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 cbd3a36399..aacc656da8 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); } |