Skip Menu |

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

Report information
The Basics
Id: 107450
Status: open
Priority: 0/
Queue: Win32-API

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

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



Subject: long double troubles with 5.22.0
While trying to build+install Win32-API-0.82 on 64bit 5.22.0 perl (built with gcc-4.9.2) I have experienced the failure in t/00_API.t
#   Failed test 'function call with double arguments'
#   at t/00_API.t line 193.
NOTE: it is the only failing test

I do not have more details at the moment.
Here is perl -V
c:\strawberry_build\debug>perl -V
Summary of my perl5 (revision 5 version 22 subversion 0) configuration:

  Platform:
    osname=MSWin32, osvers=6.3, archname=MSWin32-x64-multi-thread-ld
    uname='Win32 strawberry-perl-ld 5.22.0.1 #1 Thu Oct  1 16:10:20 2015 x64'
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    use64bitint=define, use64bitall=undef, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE  -DPERL_TEXTMODE_
SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -D__USE_MINGW_ANSI_STDIO -fw
rapv -fno-strict-aliasing -mms-bitfields',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='4.9.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678, doubleki
nd=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdbl
kind=3
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=16, Off_t='long l
ong', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\li
b"'
    libpth=C:\strawberry\c\lib C:\strawberry\c\x86_64-w64-mingw32\lib C:\strawbe
rry\c\lib\gcc\x86_64-w64-mingw32\4.9.2
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion
 -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladva
pi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lver
sion -lodbc32 -lodbccp32 -lcomctl32
    libc=, so=dll, useshrplib=true, libperl=libperl522.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\st
rawberry\c\lib"'


Characteristics of this binary (from libperl):
  Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY
                        PERLIO_LAYERS PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
                        PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE
                        PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS
                        USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
                        USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
                        USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF
  Built under MSWin32
  Compiled at Oct  1 2015 16:17:00
  @INC:
    C:/strawberry/perl/site/lib/MSWin32-x64-multi-thread-ld
    C:/strawberry/perl/site/lib
    C:/strawberry/perl/vendor/lib
    C:/strawberry/perl/lib
    .
On Thu Oct 01 13:34:45 2015, KMX wrote: Show quoted text
> While trying to build+install Win32-API-0.82 on 64bit 5.22.0 perl > (built with > gcc-4.9.2) I have experienced the failure in t/00_API.t > > # Failed test 'function call with double arguments' > # at t/00_API.t line 193. > > NOTE: it is the only failing test > > I do not have more details at the moment.
Are you using a public Strawberry Perl or this is just a private GCC build with long double NVs as an experiment?
I am trying to build 64bit portable strawberry perl 5.22.0 with long double NV (via dmake USE_LONG_DOUBLE=define).

I am still tuning the build. Once I am finished I will make it available for experimenting on http://strawberryperl.com/beta.html + post a notice here.
USE_LONG_DOUBLE build is available at http://strawberryperl.com/beta.html


Hi, here is an update with Win32-API-0.84 on perl 5.022003(RC4) built for MSWin32-x64-multi-thread-ld
##### FAILURE 1 #####
t/02_Callback.t ...... 1/20 # Compiler name:gcc
# Compiler version:0
# $^E=

#   Failed test 'do_callback_void_d was successful'
#   at t/02_Callback.t line 199.
#          got: '9876.54320000000007'
#     expected: '9876.5432'
# Looks like you failed 1 test of 20.
t/02_Callback.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/20 subtests
        (less 5 skipped subtests: 14 okay)

##### FAILURE 2 #####
t\00_API.t ..
1..58
ok 1 - use Encode;
ok 2 - use Win32::API;
# 00_API.t entered RUN phase
ok 3 - use Win32;
ok 4 - loaded
# API test dll found at (API_test64.dll)
ok 5 - found API test dll
ok 6 - GetCurrentProcessId() function found# $test_dll abs path is "C:\tmpld\data\.cpanm\work\1477466704.26464\Win32-API-0.84\API_test64.dll"

ok 7 - GetCurrentProcessId() result ok
ok 8 - GetCurrentProcessId() result ok
ok 9 - Import of GetCurrentProcessId() function from kernel32.dll
ok 10 - GetCurrentProcessId() result ok
ok 11 - Import of IsBadReadPtr function from kernel32.dll
ok 12 - API test dll was freed
ok 13 # skip ULONG is an 8 byte integer on x64 on old api

ok 14 # skip ULONG is an 8 byte integer on x64 on old api#   Failed test 'function call with double arguments'

ok 15 - GetHandle operates correctly#   at t\00_API.t line 193.

ok 16 - FreeHandle operates correctly
ok 17 - sum_integers() function defined
ok 18 - function call with integer arguments and return value (Call)
ok 19 - function call with negative integer arguments and return value (Call) \#94906
ok 20 - Import() on sum_integers worked
ok 21 - function call with integer arguments and return value (Import)
ok 22 - sum_integers_ref() function defined
ok 23 - sum_integers_ref() returns the expected value
ok 24 - sum_integers_ref() correctly modifies its ref argument
ok 25 - short as return type croak because they are structs on old API
ok 26 - sum_shorts_ref() function defined
ok 27 - shorts croak as struct objs on old API
ok 28 - API_test.dll sum_doubles function defined
not ok 29 - function call with double arguments


ad Callback.t perhaps a patch like this might help:
- is($result, 9876.5432, "do_callback_void_d was successful");
+ ok(abs($result - 9876.5432) < 0.0001, "do_callback_void_d was successful");

ad 00_API.t
- ok($function->Call(2.5, 3.2) == 5.7, 'function call with double arguments');
+ ok(abs($function->Call(2.5, 3.2) - 5.7) < 0.1, 'function call with double arguments');