From: Chris Marshall
Sent: Wednesday, February 01, 2017 4:24 AM
To: [email protected] ; perldl
Subject: [Pdl-general] CHM/OpenGL-Modern-0.01_05.tar.gz has been released toCPAN

...and should be appearing at a mirror near you soon.

Hi Chris,
On MSWindows, there's a problem with t/02_glGetShaderInfoLog.t in that it can be run only on 64-bit builds (ie only on perls whose $Config{archname} =~ /x64/).

For 32-bit builds, we find:
a) if ivsize == 4, then 'Q' is an invalid type for unpack
or
b) if ivsize == 8, then (at line 24) "unpack('Q',pack('p',$len))" returns undef - which causes the script to crash.

On these 32-bit builds, the problem is that $Config{ptrsize} is 4.

Something like the attached patch works fine for me.
AFAIK (unchecked) the above problem is not limited to Windows.

For some reason that I couldn't immediately spot, 'make realclean' removes both META.yml and META.json - so the Makefile.PL step of subsequent builds in the same build directory report that those 2 files are missing. I don't think that's correct behaviour .... but it doesn't break anything for me.

Cheers,
Rob

--- 02_glGetShaderInfoLog.t_orig        2017-02-01 11:36:49 +1100
+++ 02_glGetShaderInfoLog.t     2017-02-01 11:41:05 +1100
@@ -1,5 +1,6 @@
#!perl -w
use strict;
+use Config;
use Test::More tests => 2;
use OpenGL::Modern ':all';

@@ -21,7 +22,8 @@

warn "Looking for errors";
my $ok = "\0" x 4;
-glGetShaderiv_c($id, GL_COMPILE_STATUS, unpack('Q',pack('p',$ok)));
+my $pack_type = $Config{ptrsize} == 4 ? 'L' : 'Q';
+glGetShaderiv_c($id, GL_COMPILE_STATUS, unpack($pack_type,pack('p',$ok)));
$ok = unpack 'I', $ok;
if( $ok == GL_FALSE ) {
    pass "We recognize an invalid shader as invalid";
@@ -29,7 +31,7 @@
    my $bufsize = 1024*64;
    my $len = "\0" x 4;
    my $buffer = "\0" x $bufsize;
-    glGetShaderInfoLog_c( $id, $bufsize, unpack('Q',pack('p',$len)),
$buffer);
+    glGetShaderInfoLog_c( $id, $bufsize, unpack($pack_type,pack('p',$len)),
$buffer);
    $len = unpack 'I', $len;
    my $log = substr $buffer, 0, $len;
    isnt $log, '', "We get some error message";
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to