Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[rt.cpan.org #75671] Does not compile anymore because of typemap problems

44 views
Skip to first unread message

Slaven_Rezic via RT

unread,
Mar 10, 2012, 10:30:01 AM3/10/12
to libw...@perl.org
Sat Mar 10 10:30:01 2012: Request 75671 was acted upon.
Transaction: Ticket created by SREZIC
Queue: Win32-Registry
Subject: Does not compile anymore because of typemap problems
Broken in: 0.10
Severity: (no value)
Owner: Nobody
Requestors: SRE...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75671 >


It seems that the module does not compile anymore. See
http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec-9aeec8b7ec30
for a sample fail report. It looks like a typemap problem:

Could not find a typemap for C type 'FILETIME' in Registry.xs, line 548

Regards,
Slaven

Slaven_Rezic via RT

unread,
Mar 10, 2012, 12:11:22 PM3/10/12
to libw...@perl.org
Sat Mar 10 12:11:21 2012: Request 75671 was acted upon.
Transaction: Correspondence added by SREZIC
Queue: Win32-Registry
Subject: Does not compile anymore because of typemap problems
Broken in: 0.10
Severity: (no value)
Owner: Nobody
Requestors: SRE...@cpan.org
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75671 >


On 2012-03-10 10:30:01, SREZIC wrote:
> It seems that the module does not compile anymore. See
>
http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec-9aeec8b7ec30
> for a sample fail report. It looks like a typemap problem:
>
> Could not find a typemap for C type 'FILETIME' in Registry.xs,
line 548
>

A patch is available at:

http://cpan.perl.org/authors/id/S/SR/SREZIC/patches/Win32-Registry-0.10-SREZIC-03.patch

Regards,
Slaven

Steve Hay via RT

unread,
May 22, 2012, 4:14:24 AM5/22/12
to libw...@perl.org
Tue May 22 04:14:23 2012: Request 75671 was acted upon.
Transaction: Correspondence added by SHAY
Queue: Win32-Registry
Subject: Does not compile anymore because of typemap problems
Broken in: 0.10
Severity: (no value)
Owner: Nobody
Requestors: SRE...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75671 >


On Sat Mar 10 12:11:21 2012, SREZIC wrote:
> On 2012-03-10 10:30:01, SREZIC wrote:
> > It seems that the module does not compile anymore. See
> >
> http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec-
> 9aeec8b7ec30
> > for a sample fail report. It looks like a typemap problem:
> >
> > Could not find a typemap for C type 'FILETIME' in Registry.xs,
> line 548
> >
>
> A patch is available at:
>
> http://cpan.perl.org/authors/id/S/SR/SREZIC/patches/Win32-Registry-
> 0.10-SREZIC-03.patch
>
> Regards,
> Slaven


I've just encountered the same problem when rebuilding things with
perl-5.16.0 and solved it in much the same way. (I actually put FILETIME
T_HANDLE in the typemap; I don't know if that's better or worse than
T_PTROBJ.)

Sisyphus via RT

unread,
May 22, 2012, 5:38:31 AM5/22/12
to libw...@perl.org
Tue May 22 05:38:29 2012: Request 75671 was acted upon.
Transaction: Correspondence added by SISYPHUS
Queue: Win32-Registry
Subject: Does not compile anymore because of typemap problems
Broken in: 0.10
Severity: (no value)
Owner: Nobody
Requestors: SRE...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75671 >


On Tue May 22 04:14:23 2012, SHAY wrote:
>
> I've just encountered the same problem when rebuilding things with
> perl-5.16.0 and solved it in much the same way. (I actually put FILETIME
> T_HANDLE in the typemap; I don't know if that's better or worse than
> T_PTROBJ.)

It doesn't matter what you specify - specifying T_CRAP will work just as
well.
The problem is that there's some shonkiness in Registry.xs. Earlier
versions of EU::ParseXS didn't worry about it, but more recent versions do.

I've been using the following patch to Registry.xs:

#############################################
--- Registry.xs 2012-05-22 19:19:27 +1000
+++ Registry.xs_fixed 2012-05-22 19:15:18 +1000
@@ -545,7 +545,7 @@
DWORD idx
char *subkey = NO_INIT
char *classname = NO_INIT
- FILETIME lastwritetime = NO_INIT
+ SV * lastwritetime = NO_INIT
CODE:
char keybuffer[TMPBUFSZ];
DWORD keybuffersz = TMPBUFSZ;
@@ -775,7 +775,7 @@
DWORD maxvalnamelen = NO_INIT
DWORD maxvaldatalen = NO_INIT
DWORD secdesclen = NO_INIT
- FILETIME lastwritetime = NO_INIT
+ SV * lastwritetime = NO_INIT
CODE:
char keyclass[TMPBUFSZ];
FILETIME ft;
#############################################

I don't remember if I came up with that myself, or whether it was
someone else. (If it was me that wrote it, then it might still be shonky.)

Anyway, with that patch applied the idiotic 'no typemap entry' error
goes away.

Cheers,
Rob


Max Vohlken via RT

unread,
Nov 29, 2012, 1:38:59 PM11/29/12
to libw...@perl.org
Thu Nov 29 13:38:58 2012: Request 75671 was acted upon.
Transaction: Correspondence added by maxvohlken
Queue: Win32-Registry
Subject: Does not compile anymore because of typemap problems
Broken in: 0.10
Severity: (no value)
Owner: Nobody
Requestors: SRE...@cpan.org
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75671 >


Here is a more accurate patch. This will correctly return the
lastwritetime as an integer. I changed it to use the typemap to convert
the FILETIME value to a time_t and then return it as a perl integer.

*** Registry.xs.orig Fri May 09 16:41:22 2008
--- Registry.xs Thu Nov 29 00:28:01 2012
***************
*** 551,559 ****
DWORD keybuffersz = TMPBUFSZ;
char classbuffer[TMPBUFSZ];
DWORD classbuffersz = TMPBUFSZ;
- FILETIME ft;
LONG result = RegEnumKeyEx(hkey, idx, keybuffer, &keybuffersz,
! 0, classbuffer, &classbuffersz, &ft);
/* supress unreferenced variable warning */
(void)subkey;
(void)classname;
--- 551,558 ----
DWORD keybuffersz = TMPBUFSZ;
char classbuffer[TMPBUFSZ];
DWORD classbuffersz = TMPBUFSZ;
LONG result = RegEnumKeyEx(hkey, idx, keybuffer, &keybuffersz,
! 0, classbuffer, &classbuffersz, &lastwritetime);
/* supress unreferenced variable warning */
(void)subkey;
(void)classname;
***************
*** 565,571 ****
RETVAL
subkey if (RETVAL) { SETPV(2, keybuffer); }
classname if (RETVAL) { SETPV(3, classbuffer); }
! lastwritetime if (RETVAL) { SETNV(4, ft2timet(&ft)); }

bool
RegEnumValue(hkey,idx,name,reserved,type,value)
--- 564,570 ----
RETVAL
subkey if (RETVAL) { SETPV(2, keybuffer); }
classname if (RETVAL) { SETPV(3, classbuffer); }
! lastwritetime

bool
RegEnumValue(hkey,idx,name,reserved,type,value)
***************
*** 778,784 ****
FILETIME lastwritetime = NO_INIT
CODE:
char keyclass[TMPBUFSZ];
- FILETIME ft;
LONG result;
/* supress unreferenced variable warning */
(void)kclass;
--- 777,782 ----
***************
*** 789,795 ****
&numsubkeys, &maxsubkeylen,
&maxclasslen, &numvalues,
&maxvalnamelen, &maxvaldatalen,
! &secdesclen, &ft);
RETVAL = SUCCESS(result);
if (!RETVAL)
SetLastError(result);
--- 787,793 ----
&numsubkeys, &maxsubkeylen,
&maxclasslen, &numvalues,
&maxvalnamelen, &maxvaldatalen,
! &secdesclen, &lastwritetime);
RETVAL = SUCCESS(result);
if (!RETVAL)
SetLastError(result);
***************
*** 803,809 ****
maxvalnamelen
maxvaldatalen
secdesclen
! lastwritetime if (RETVAL) { ft2timet(&ft); }


bool
--- 801,807 ----
maxvalnamelen
maxvaldatalen
secdesclen
! lastwritetime


bool
*** typemap.orig Wed Feb 13 19:59:25 2008
--- typemap Thu Nov 29 00:30:24 2012
***************
*** 2,7 ****
--- 2,8 ----
REGSAM T_HANDLE
HKEY T_HANDLE
HANDLE T_HANDLE
+ FILETIME T_FILETIME


#############################################################################
INPUT
***************
*** 11,16 ****
--- 12,20 ----


#############################################################################
OUTPUT
+
+ T_FILETIME
+ sv_setiv($arg, ft2timet(&$var));

T_HANDLE
sv_setiv($arg, PTR2IV($var));

0 new messages