Skip Menu |

This queue is for tickets about the Win32-GuiTest CPAN distribution.

Report information
The Basics
Id: 59838
Status: resolved
Priority: 0/
Queue: Win32-GuiTest

People
Owner: Nobody in particular
Requestors: alabamapaul [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.57
Fixed in: (no value)



Subject: Will not build in x64
First and foremost, thanks for the hard work on a very helpful module! We are wanting to use this module on the Vista and Windows 64 bit platform and encountered some problems... Win32::GuiTest does not build under Strawberry perl 5.12.0.1 x64 on Vista or Windows 7 64-bit. You can use the developer version of Win32::API (v0.60_64) to allow Win32::API to build, test, and install in the x64 environment. The attached patch allows Win32::GuiTest to build, test, and install using Strwaberry perl v5.10.1.1 in Windows 7 (32-bit) and Strawberry perl v5.12.0.1 on Wista and Windows 7 (64-bit). If the SIZE_T definition is present, then this produces a conflicting declaration. Eliminating the define corrected the problem in x64, and did not create a problem in x86. At lines 694 and 695, casting the parameters to LONG generates an error in x64 "cast from 'void*' to 'LONG' loses precisions. Changing these to UV instead of LONG works in both x64 and x86 builds. If you need more details, or would like me to test an alternate patch, please let me know. Thanks, Paul
Subject: Win32-GuiTest-1.57-x64.patch
--- GuiTest.xs +++ patched/GuiTest.xs 2010-07-29 14:14:17.157312500 -0500 @@ -15,9 +15,6 @@ #define WIN32_LEAN_AND_MEAN #define _WIN32_IE 0x0500 -#ifndef SIZE_T -# define SIZE_T DWORD -#endif #include <windows.h> #include <commctrl.h> #include "dibsect.h" @@ -691,8 +688,8 @@ die( "VirtualAllocEx failed with error %d: %s", dw, lpMsgBuf ); }else{ - XPUSHs( sv_2mortal( newSVuv( ( LONG )pBuffer ) ) ); - XPUSHs( sv_2mortal( newSVuv( ( LONG )hProcess ) ) ); + XPUSHs( sv_2mortal( newSVuv( ( UV )pBuffer ) ) ); + XPUSHs( sv_2mortal( newSVuv( ( UV )hProcess ) ) ); }
Show quoted text
> If the SIZE_T definition is present, then this produces a conflicting > declaration. Eliminating the define corrected the problem in x64, and > did not create a problem in x86.
Yes, the definition of SIZE_T looks doubtful, but I rather wouldn't remove it without seeing tests also on 5.10 and on cygwin. If you could test there environments as well, I'd be grateful. Show quoted text
> At lines 694 and 695, casting the parameters to LONG generates an error > in x64 "cast from 'void*' to 'LONG' loses precisions. > Changing these to UV instead of LONG works in both x64 and x86 builds.
This one is applied. Thanks for the great work! /dk
From: alabamapaul [...] gmail.com
On Thu Jul 29 16:15:40 2010, KARASIK wrote: Show quoted text
> > If the SIZE_T definition is present, then this produces a conflicting > > declaration. Eliminating the define corrected the problem in x64, and > > did not create a problem in x86.
> > Yes, the definition of SIZE_T looks doubtful, but I rather wouldn't > remove it without seeing tests also on 5.10 and on cygwin. If you could > test there environments as well, I'd be grateful. >
I did test with Strawberry perl v5.10.1.1 on 32-bit, and removing SIZE_T worked. Unfortunately I do not have a cygwin environment available.
perl5.10 with MSVC doesn't like SIZE_T undefined. However it likes that if I move #define after #include statement. Can you try this and confirm is this works in your setup? What I mean is this: #define WIN32_LEAN_AND_MEAN #define _WIN32_IE 0x0500 #include <windows.h> #include <commctrl.h> #include "dibsect.h" #ifndef SIZE_T # define SIZE_T DWORD #endif
From: alabamapaul [...] gmail.com
On Fri Jul 30 08:10:52 2010, KARASIK wrote: Show quoted text
> perl5.10 with MSVC doesn't like SIZE_T undefined. However it likes
that Show quoted text
> if I move #define after #include statement. Can you try this and
confirm Show quoted text
> is this works in your setup? What I mean is this: > > #define WIN32_LEAN_AND_MEAN > #define _WIN32_IE 0x0500 > #include <windows.h> > #include <commctrl.h> > #include "dibsect.h" > #ifndef SIZE_T > # define SIZE_T DWORD > #endif > >
This does not work on 64-bit Strawberry Perl v5.12.0.1. Since this seems to be a difference between MSVC and GNUC, maybe we could leave it where it is, and and another conditional like so... #ifndef SIZE_T # ifndef __GNUC__ # define SIZE_T DWORD # endif #endif This works on both 32-bit Strawberry Perl 5.10.1.1 and 64-bit Strawberry Perl 5.12.0.1. If this works in MSVC and you choose to use it as the solution, I highly recommend adding a comment block above it explaining the reason. This way, anyone looking at the code later will understand.
This makes sense, thanks! So, just to make clear, does the following work for you? #define WIN32_LEAN_AND_MEAN #define _WIN32_IE 0x0500 #ifndef SIZE_T # ifndef __GNUC__ # define SIZE_T DWORD # endif #endif #include <windows.h> #include <commctrl.h> #include "dibsect.h" I've tested it only on perls I'm having access now, 5.8/cygwin, 5.10/ MSVC, and 5.12/strawberry, seems ok.
Subject: Re: [rt.cpan.org #59838] Will not build in x64
Date: Fri, 30 Jul 2010 12:56:36 -0500
To: bug-Win32-GuiTest [...] rt.cpan.org
From: Paul <alabamapaul [...] gmail.com>
Yes, that works on Win7 32-bit Strawberry Perl v5.10.1.1 and Vista 64-bit Strawberry Perl v5.12.0.1 On Fri, Jul 30, 2010 at 12:08 PM, KARASIK via RT <bug-Win32-GuiTest@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=59838 > > > This makes sense, thanks! So, just to make clear, does the following > work for you? > > #define WIN32_LEAN_AND_MEAN > #define _WIN32_IE 0x0500 > #ifndef SIZE_T > #   ifndef __GNUC__ > #      define SIZE_T DWORD > #   endif > #endif > #include <windows.h> > #include <commctrl.h> > #include "dibsect.h" > > I've tested it only on perls I'm having access now, 5.8/cygwin, 5.10/ > MSVC, and 5.12/strawberry, seems ok. >
Committed, thanks! The change will appear in the next version.