Front page | perl.perl5.changes |
Postings from April 2008
Change 33755: Integrate:
From:
Nicholas Clark
Date:
April 27, 2008 02:00
Subject:
Change 33755: Integrate:
Change 33755 by nicholas@mouse-mill on 2008/04/27 08:54:23
Integrate:
[ 33720]
Upgrade to Win32-0.36
Affected files ...
... //depot/maint-5.10/perl/ext/Win32/Changes#3 integrate
... //depot/maint-5.10/perl/ext/Win32/Win32.pm#4 integrate
... //depot/maint-5.10/perl/ext/Win32/Win32.xs#5 integrate
Differences ...
==== //depot/maint-5.10/perl/ext/Win32/Changes#3 (text) ====
Index: perl/ext/Win32/Changes
--- perl/ext/Win32/Changes#2~33642~ 2008-04-03 10:06:15.000000000 -0700
+++ perl/ext/Win32/Changes 2008-04-27 01:54:23.000000000 -0700
@@ -1,5 +1,8 @@
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)
==== //depot/maint-5.10/perl/ext/Win32/Win32.pm#4 (text) ====
Index: perl/ext/Win32/Win32.pm
--- perl/ext/Win32/Win32.pm#3~33642~ 2008-04-03 10:06:15.000000000 -0700
+++ perl/ext/Win32/Win32.pm 2008-04-27 01:54:23.000000000 -0700
@@ -8,7 +8,7 @@
require DynaLoader;
@ISA = qw|Exporter DynaLoader|;
- $VERSION = '0.35';
+ $VERSION = '0.36';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
==== //depot/maint-5.10/perl/ext/Win32/Win32.xs#5 (text) ====
Index: perl/ext/Win32/Win32.xs
--- perl/ext/Win32/Win32.xs#4~33642~ 2008-04-03 10:06:15.000000000 -0700
+++ perl/ext/Win32/Win32.xs 2008-04-27 01:54:23.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;
}
@@ -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;
}
End of Patch.
-
Change 33755: Integrate:
by Nicholas Clark