Change 33818 by [EMAIL PROTECTED] on 2008/05/11 09:52:32
Integrate:
[ 33642]
Integrate:
[ 33480]
Subject: Re: Perl @ http://www.ccl4.org/~nick/P/perl-33444.tar.bz2
From: Reini Urban <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 08 Mar 2008 20:55:36 +0100
CYG09 enhance GetCurrentThreadId test
[ 33482]
Subject: Re: Perl @ http://www.ccl4.org/~nick/P/perl-33444.tar.bz2
From: Reini Urban <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 08 Mar 2008 20:55:36 +0100
* CYG10 improve Win32::GetLastError test
[ 33543]
Subject: Re: Smoke [5.11.0] 33500 FAIL(F) MSWin32 WinXP/.Net SP2 (x86/2
cpu)
From: Nicholas Clark <[EMAIL PROTECTED]>
Date: Thu, 13 Mar 2008 12:47:51 +0000
Message-ID: <[EMAIL PROTECTED]>
Fixes test failures introduced by #33480 in non-fork()-enabled builds.
[ 33625]
Upgrade to Win32-0.35
[ 33755]
Integrate:
[ 33720]
Upgrade to Win32-0.36
Affected files ...
... //depot/maint-5.8/perl/ext/Win32/Changes#2 integrate
... //depot/maint-5.8/perl/ext/Win32/Makefile.PL#3 integrate
... //depot/maint-5.8/perl/ext/Win32/Win32.pm#6 integrate
... //depot/maint-5.8/perl/ext/Win32/Win32.xs#6 integrate
... //depot/maint-5.8/perl/ext/Win32/t/GetCurrentThreadId.t#2 integrate
... //depot/maint-5.8/perl/ext/Win32CORE/t/win32core.t#3 integrate
Differences ...
==== //depot/maint-5.8/perl/ext/Win32/Changes#2 (text) ====
Index: perl/ext/Win32/Changes
--- perl/ext/Win32/Changes#1~32450~ 2007-11-22 09:45:52.000000000 -0800
+++ perl/ext/Win32/Changes 2008-05-11 02:52:32.000000000 -0700
@@ -1,114 +1,123 @@
-Revision history for the Perl extension Win32.
-
-0.34 [2007-11-21]
- - Document "WinVista" return value for Win32::GetOSName()
- (Steve Hay).
-
-0.33 [2007-11-12]
- - Update version to 0.33 for Perl 5.10 release
- - Add $^O test in Makefile.PL for CPAN Testers
- - Use Win32::GetLastError() instead of $^E in t/Names.t for
- cygwin compatibility (Jerry D. Hedden).
-
-0.32 [2007-09-20]
- - Additional #define's for older versions of VC++ (Dmitry Karasik).
- - Win32::DomainName() doesn't return anything when the Workstation
- service isn't running. Set $^E and adapt t/Names.t accordingly
- (Steve Hay & Jerry D. Hedden).
- - Fix t/Names.t to allow Win32::GetOSName() to return an empty
- description as the 2nd return value (e.g. Vista without SP).
- - Fix t/GetFileVersion.t for Perl 5.10
-
-0.31 [2007-09-10]
- - Apply Cygwin fixes from bleadperl (from Jerry D. Hedden).
- - Make sure Win32::GetLongPathName() always returns drive
- letters in uppercase (Jerry D. Hedden).
- - Use uppercase environment variable names in t/Unicode.t
- because the MSWin32 doesn't care, and Cygwin only works
- with the uppercased version.
- - new t/Names.t test (from Sébastien Aperghis-Tramoni)
-
-0.30 [2007-06-25]
- - Fixed t/Unicode.t test for Cygwin (with help from Jerry D. Hedden).
- - Fixed and documented Win32::GetShortPathName() to return undef
- when the pathname doesn't exist (thanks to Steve Hay).
- - Added t/GetShortPathName.t
-
-0.29 [2007-05-17]
- - Fixed to compile with Borland BCC (thanks to Steve Hay).
-
-0.28_01 [2007-05-16]
- - Increase version number as 0.28 was already used by an ActivePerl
- release (for essentially 0.27 plus the Win32::IsAdminUser() change).
-
- - Add MODULE and PROTOTYPES directives to silence warnings from
- newer versions of xsubpp.
-
- - Use the Cygwin codepath in Win32::GetFullPathName() when
- PERL_IMPLICIT_SYS is not defined, because the other code
- relies on the virtualization code in win32/vdir.h.
-
-0.27_02 [2007-05-15]
- - We need Windows 2000 or later for the Unicode support because
- WC_NO_BEST_FIT_CHARS is not supported on Windows NT.
-
- - Fix Win32::GetFullPathName() on Windows NT to return an
- empty file part if the original argument ends with a slash.
-
-0.27_01 [2007-04-18]
- - Update Win32::IsAdminUser() to use the IsUserAnAdmin() function
- in shell32.dll when available. On Windows Vista this will only
- return true if the process is running with elevated privileges
- and not just when the owner of the process is a member of the
- "Administrators" group.
-
- - Win32::ExpandEnvironmentStrings() may return a Unicode string
- (a string containing characters outside the system codepage)
-
- - new Win32::GetANSIPathName() function returns a pathname in
- a form containing only characters from the system codepage
-
- - Win32::GetCwd() will return an ANSI version of the directory
- name if the long name contains characters outside the system
- codepage.
-
- - Win32::GetFolderPath() will return an ANSI pathname. Call
- Win32::GetLongPathName() to get the canonical Unicode
- representation.
-
- - Win32::GetFullPathName() will return an ANSI pathname. Call
- Win32::GetLongPathName() to get the canonical Unicode
- representation.
-
- - Win32::GetLongPathName() may return a Unicode path name.
- Call Win32::GetANSIPathName() to get a representation using
- only characters from the system codepage.
-
- - Win32::LoginName() may return a Unicode string.
-
- - new Win32::OutputDebugString() function sends a string to
- the debugger.
-
- - new Win32::GetCurrentThreadId() function returns the thread
- id (to complement the process id in $$).
-
- - new Win32::CreateDirectory() creates a new directory. The
- name of the directory may contain Unicode characters outside
- the system codepage.
-
- - new Win32::CreateFile() creates a new file. The name of the
- file may contain Unicode characters outside the system codepage.
-
-
-0.27 [2007-03-07]
- - Extracted from the libwin32 distribution to simplify maintenance
- because Win32 is a dual-life core module since 5.8.4.
-
- - Win32.pm and Win32.xs updated to version in bleadperl.
- This includes all the Win32::* function from win32/win32.c
- in core Perl, except for Win32::SetChildShowWindows().
-
- - Install into 'perl' directory instead of 'site' for Perl 5.8.4
- and later.
-
- - Add some simple tests.
+Revision history for the Perl extension Win32.
+
+0.36 [2008-04-17]
+ - Add typecasts for Win64 compilation
+
+0.35 [2008-03-31]
+ Integrate changes from bleadperl:
+ - Silence Borland compiler warning (Steve Hay)
+ - Fix memory leak in Win32::GetOSVersion (Vincent Pit)
+ - Test Win32::GetCurrentThreadId on cygwin (Reini Urban, Steve Hay)
+
+0.34 [2007-11-21]
+ - Document "WinVista" return value for Win32::GetOSName()
+ (Steve Hay).
+
+0.33 [2007-11-12]
+ - Update version to 0.33 for Perl 5.10 release
+ - Add $^O test in Makefile.PL for CPAN Testers
+ - Use Win32::GetLastError() instead of $^E in t/Names.t for
+ cygwin compatibility (Jerry D. Hedden).
+
+0.32 [2007-09-20]
+ - Additional #define's for older versions of VC++ (Dmitry Karasik).
+ - Win32::DomainName() doesn't return anything when the Workstation
+ service isn't running. Set $^E and adapt t/Names.t accordingly
+ (Steve Hay & Jerry D. Hedden).
+ - Fix t/Names.t to allow Win32::GetOSName() to return an empty
+ description as the 2nd return value (e.g. Vista without SP).
+ - Fix t/GetFileVersion.t for Perl 5.10
+
+0.31 [2007-09-10]
+ - Apply Cygwin fixes from bleadperl (from Jerry D. Hedden).
+ - Make sure Win32::GetLongPathName() always returns drive
+ letters in uppercase (Jerry D. Hedden).
+ - Use uppercase environment variable names in t/Unicode.t
+ because the MSWin32 doesn't care, and Cygwin only works
+ with the uppercased version.
+ - new t/Names.t test (from Sébastien Aperghis-Tramoni)
+
+0.30 [2007-06-25]
+ - Fixed t/Unicode.t test for Cygwin (with help from Jerry D. Hedden).
+ - Fixed and documented Win32::GetShortPathName() to return undef
+ when the pathname doesn't exist (thanks to Steve Hay).
+ - Added t/GetShortPathName.t
+
+0.29 [2007-05-17]
+ - Fixed to compile with Borland BCC (thanks to Steve Hay).
+
+0.28_01 [2007-05-16]
+ - Increase version number as 0.28 was already used by an ActivePerl
+ release (for essentially 0.27 plus the Win32::IsAdminUser() change).
+
+ - Add MODULE and PROTOTYPES directives to silence warnings from
+ newer versions of xsubpp.
+
+ - Use the Cygwin codepath in Win32::GetFullPathName() when
+ PERL_IMPLICIT_SYS is not defined, because the other code
+ relies on the virtualization code in win32/vdir.h.
+
+0.27_02 [2007-05-15]
+ - We need Windows 2000 or later for the Unicode support because
+ WC_NO_BEST_FIT_CHARS is not supported on Windows NT.
+
+ - Fix Win32::GetFullPathName() on Windows NT to return an
+ empty file part if the original argument ends with a slash.
+
+0.27_01 [2007-04-18]
+ - Update Win32::IsAdminUser() to use the IsUserAnAdmin() function
+ in shell32.dll when available. On Windows Vista this will only
+ return true if the process is running with elevated privileges
+ and not just when the owner of the process is a member of the
+ "Administrators" group.
+
+ - Win32::ExpandEnvironmentStrings() may return a Unicode string
+ (a string containing characters outside the system codepage)
+
+ - new Win32::GetANSIPathName() function returns a pathname in
+ a form containing only characters from the system codepage
+
+ - Win32::GetCwd() will return an ANSI version of the directory
+ name if the long name contains characters outside the system
+ codepage.
+
+ - Win32::GetFolderPath() will return an ANSI pathname. Call
+ Win32::GetLongPathName() to get the canonical Unicode
+ representation.
+
+ - Win32::GetFullPathName() will return an ANSI pathname. Call
+ Win32::GetLongPathName() to get the canonical Unicode
+ representation.
+
+ - Win32::GetLongPathName() may return a Unicode path name.
+ Call Win32::GetANSIPathName() to get a representation using
+ only characters from the system codepage.
+
+ - Win32::LoginName() may return a Unicode string.
+
+ - new Win32::OutputDebugString() function sends a string to
+ the debugger.
+
+ - new Win32::GetCurrentThreadId() function returns the thread
+ id (to complement the process id in $$).
+
+ - new Win32::CreateDirectory() creates a new directory. The
+ name of the directory may contain Unicode characters outside
+ the system codepage.
+
+ - new Win32::CreateFile() creates a new file. The name of the
+ file may contain Unicode characters outside the system codepage.
+
+
+0.27 [2007-03-07]
+ - Extracted from the libwin32 distribution to simplify maintenance
+ because Win32 is a dual-life core module since 5.8.4.
+
+ - Win32.pm and Win32.xs updated to version in bleadperl.
+ This includes all the Win32::* function from win32/win32.c
+ in core Perl, except for Win32::SetChildShowWindows().
+
+ - Install into 'perl' directory instead of 'site' for Perl 5.8.4
+ and later.
+
+ - Add some simple tests.
==== //depot/maint-5.8/perl/ext/Win32/Makefile.PL#3 (text) ====
Index: perl/ext/Win32/Makefile.PL
--- perl/ext/Win32/Makefile.PL#2~32310~ 2007-11-14 09:01:40.000000000 -0800
+++ perl/ext/Win32/Makefile.PL 2008-05-11 02:52:32.000000000 -0700
@@ -1,20 +1,18 @@
use 5.006;
+use strict;
+use warnings;
use ExtUtils::MakeMaker;
unless ($^O eq "MSWin32" || $^O eq "cygwin") {
die "OS unsupported\n";
}
-my @libs;
-push @libs, '-L/lib/w32api -lole32 -lversion' if $^O eq "cygwin";
-
-WriteMakefile(
+my %param = (
NAME => 'Win32',
VERSION_FROM => 'Win32.pm',
- LIBS => [EMAIL PROTECTED],
INSTALLDIRS => ($] >= 5.008004 ? 'perl' : 'site'),
- NO_META => 1,
-
- AUTHOR => 'Jan Dubois <[EMAIL PROTECTED]>',
- ABSTRACT_FROM => 'Win32.pm',
);
+$param{NO_META} = 1 if eval "$ExtUtils::MakeMaker::VERSION" >= 6.10_03;
+$param{LIBS} = ['-L/lib/w32api -lole32 -lversion'] if $^O eq "cygwin";
+
+WriteMakefile(%param);
==== //depot/maint-5.8/perl/ext/Win32/Win32.pm#6 (text) ====
Index: perl/ext/Win32/Win32.pm
--- perl/ext/Win32/Win32.pm#5~33593~ 2008-03-28 12:45:31.000000000 -0700
+++ perl/ext/Win32/Win32.pm 2008-05-11 02:52:32.000000000 -0700
@@ -8,7 +8,7 @@
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.34_01';
+ $VERSION = '0.36';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
==== //depot/maint-5.8/perl/ext/Win32/Win32.xs#6 (text) ====
Index: perl/ext/Win32/Win32.xs
--- perl/ext/Win32/Win32.xs#5~33817~ 2008-05-11 02:24:16.000000000 -0700
+++ perl/ext/Win32/Win32.xs 2008-05-11 02:52:32.000000000 -0700
@@ -158,9 +158,9 @@
char *str = SvPV(sv, len);
UINT cp = SvUTF8(sv) ? CP_UTF8 : CP_ACP;
- wlen = MultiByteToWideChar(cp, 0, str, len+1, NULL, 0);
+ wlen = MultiByteToWideChar(cp, 0, str, (int)(len+1), NULL, 0);
New(0, wstr, wlen, WCHAR);
- MultiByteToWideChar(cp, 0, str, len+1, wstr, wlen);
+ MultiByteToWideChar(cp, 0, str, (int)(len+1), wstr, wlen);
return wstr;
}
@@ -171,7 +171,7 @@
SV *
wstr_to_sv(pTHX_ WCHAR *wstr)
{
- size_t wlen = wcslen(wstr)+1;
+ int wlen = (int)wcslen(wstr)+1;
BOOL use_default = FALSE;
int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, wstr, wlen,
NULL, 0, NULL, NULL);
SV *sv = sv_2mortal(newSV(len));
@@ -302,7 +302,7 @@
{
char *name;
BOOL use_default = FALSE;
- size_t widelen = wcslen(widename)+1;
+ int widelen = (int)wcslen(widename)+1;
int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, widename,
widelen,
NULL, 0, NULL, NULL);
New(0, name, len, char);
@@ -619,8 +619,8 @@
}
message = SvPV_nolen(ST(1));
- bRet = InitiateSystemShutdownA(machineName, message,
- SvIV(ST(2)), SvIV(ST(3)), SvIV(ST(4)));
+ bRet = InitiateSystemShutdownA(machineName, message, (DWORD)SvIV(ST(2)),
+ (BOOL)SvIV(ST(3)), (BOOL)SvIV(ST(4)));
/* Disable shutdown privilege. */
tkp.Privileges[0].Attributes = 0;
@@ -680,7 +680,7 @@
croak("usage: Win32::MsgBox($message [, $flags [, $title]]);\n");
if (items > 1)
- flags = SvIV(ST(1));
+ flags = (DWORD)SvIV(ST(1));
if (IsWin2000()) {
WCHAR *title = NULL;
@@ -710,7 +710,11 @@
if (items != 1)
croak("usage: Win32::LoadLibrary($libname)\n");
hHandle = LoadLibraryA(SvPV_nolen(ST(0)));
- XSRETURN_IV((long)hHandle);
+#ifdef _WIN64
+ XSRETURN_IV((DWORD_PTR)hHandle);
+#else
+ XSRETURN_IV((DWORD)hHandle);
+#endif
}
XS(w32_FreeLibrary)
@@ -804,7 +808,7 @@
if (SUCCEEDED(hr)) {
LPOLESTR pStr = NULL;
if (SUCCEEDED(StringFromCLSID(&guid, &pStr))) {
- WideCharToMultiByte(CP_ACP, 0, pStr, wcslen(pStr), szGUID,
+ WideCharToMultiByte(CP_ACP, 0, pStr, (int)wcslen(pStr), szGUID,
sizeof(szGUID), NULL, NULL);
CoTaskMemFree(pStr);
XSRETURN_PV(szGUID);
@@ -825,7 +829,7 @@
if (items != 1 && items != 2)
croak("usage: Win32::GetFolderPath($csidl [, $create])\n");
- folder = SvIV(ST(0));
+ folder = (int)SvIV(ST(0));
if (items == 2)
create = SvTRUE(ST(1)) ? CSIDL_FLAG_CREATE : 0;
@@ -1112,7 +1116,7 @@
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "usage: Win32::SetLastError($error)");
- SetLastError(SvIV(ST(0)));
+ SetLastError((DWORD)SvIV(ST(0)));
XSRETURN_EMPTY;
}
@@ -1245,17 +1249,17 @@
if (GIMME_V == G_SCALAR) {
XSRETURN_IV(g_osver.dwPlatformId);
}
- mXPUSHp(g_osver.szCSDVersion, strlen(g_osver.szCSDVersion));
+ XPUSHs(sv_2mortal(newSVpvn(g_osver.szCSDVersion,
strlen(g_osver.szCSDVersion))));
- mXPUSHi(g_osver.dwMajorVersion);
- mXPUSHi(g_osver.dwMinorVersion);
- mXPUSHi(g_osver.dwBuildNumber);
- mXPUSHi(g_osver.dwPlatformId);
+ XPUSHs(sv_2mortal(newSViv(g_osver.dwMajorVersion)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.dwMinorVersion)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.dwBuildNumber)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.dwPlatformId)));
if (g_osver_ex) {
- mXPUSHi(g_osver.wServicePackMajor);
- mXPUSHi(g_osver.wServicePackMinor);
- mXPUSHi(g_osver.wSuiteMask);
- mXPUSHi(g_osver.wProductType);
+ XPUSHs(sv_2mortal(newSViv(g_osver.wServicePackMajor)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.wServicePackMinor)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.wSuiteMask)));
+ XPUSHs(sv_2mortal(newSViv(g_osver.wProductType)));
}
PUTBACK;
}
@@ -1284,7 +1288,7 @@
Perl_croak(aTHX_ "usage: Win32::FormatMessage($errno)");
if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
- &source, SvIV(ST(0)), 0,
+ &source, (DWORD)SvIV(ST(0)), 0,
msgbuf, sizeof(msgbuf)-1, NULL))
{
XSRETURN_PV(msgbuf);
@@ -1381,7 +1385,7 @@
do {
len = GetShortPathName(SvPVX(shortpath),
SvPVX(shortpath),
- SvLEN(shortpath));
+ (DWORD)SvLEN(shortpath));
} while (len >= SvLEN(shortpath) && sv_grow(shortpath,len+1));
if (len) {
SvCUR_set(shortpath,len);
@@ -1550,7 +1554,7 @@
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "usage: Win32::Sleep($milliseconds)");
- Sleep(SvIV(ST(0)));
+ Sleep((DWORD)SvIV(ST(0)));
XSRETURN_YES;
}
==== //depot/maint-5.8/perl/ext/Win32/t/GetCurrentThreadId.t#2 (text) ====
Index: perl/ext/Win32/t/GetCurrentThreadId.t
--- perl/ext/Win32/t/GetCurrentThreadId.t#1~32310~ 2007-11-14
09:01:40.000000000 -0800
+++ perl/ext/Win32/t/GetCurrentThreadId.t 2008-05-11 02:52:32.000000000
-0700
@@ -3,18 +3,18 @@
use Test;
use Win32;
-unless ($Config{ccflags} =~ /PERL_IMPLICIT_SYS/) {
- print "1..0 # Skip: Test requires fork emulation\n";
- exit 0;
-}
-
plan tests => 1;
-if (my $pid = fork) {
- waitpid($pid, 0);
- exit 0;
-}
-
# This test relies on the implementation detail that the fork() emulation
# uses the negative value of the thread id as a pseudo process id.
-ok(-$$, Win32::GetCurrentThreadId());
+if ($Config{ccflags} =~ /PERL_IMPLICIT_SYS/) {
+ if (my $pid = fork) {
+ waitpid($pid, 0);
+ exit 0;
+ }
+ ok(-$$, Win32::GetCurrentThreadId());
+}
+else {
+ # here we just want to see something.
+ ok(Win32::GetCurrentThreadId() > 0);
+}
==== //depot/maint-5.8/perl/ext/Win32CORE/t/win32core.t#3 (text) ====
Index: perl/ext/Win32CORE/t/win32core.t
--- perl/ext/Win32CORE/t/win32core.t#2~32310~ 2007-11-14 09:01:40.000000000
-0800
+++ perl/ext/Win32CORE/t/win32core.t 2008-05-11 02:52:32.000000000 -0700
@@ -10,11 +10,7 @@
}
}
- if ($^O eq 'cygwin') {
- plan skip_all => '$^E is not Win32::GetLastError() under Cygwin';
- } else {
plan tests => 4;
- }
};
use_ok( "Win32CORE" );
@@ -24,7 +20,7 @@
# [perl #42925] - Loading Win32::GetLastError() via the forwarder function
# should not affect the last error being retrieved
$^E = 42;
-is(Win32::GetLastError(), 42, 'GetLastError() works on the first call');
+is(Win32::GetLastError(), $^O eq 'cygwin' ? 0 : 42, 'GetLastError() works on
the first call');
# Now all Win32::* functions should be loaded
ok(defined &Win32::ExpandEnvironmentStrings);
End of Patch.