develooper Front page | perl.perl5.porters | Postings from November 2005

[perl #37708] wrong IP_ constants on Win32

Thread Next
From:
Guest via RT
Date:
November 21, 2005 08:44
Subject:
[perl #37708] wrong IP_ constants on Win32
Message ID:
rt-3.0.11-37708-124712.17.6556630661825@perl.org
> [ThomasKratz@web.de - Fri Nov 18 07:20:03 2005]:

Sorry for the missing subject. I had to copy/paste this to another mail
program and forgot to copy the subject as well.

Reading my own error report I feel I should clarify a bit (note to
myself: never file an error report in a hurry).

I am trying to build IO::Socket::Multicast 1.02 on perl 5.8.7 under Win32.
The build was ok under 5.8.4 but the tests fail under 5.8.7.

This is due to wrongly set constants defined in Winsock.h. (for example
IP_ADD_MEMBERSHIP).

Perl is compiled to use winsock2 (via ws2spi.h), but perl.h includes
winsock.h (via win32.h). As a result extensions built this way will use
the winsock 1.1 constants instead of the correct constants from
ws2tcpip.h which is not included anywhere.

Including it in the extensions XS code will result in errors due to
redefined structs. 

A workaround for IO::Socket::Multicast will be supplying the correct
constants in the XS code. But this should better be resolved by
eliminating winsock 1.1 (winsock.h) altogether.

Thomas

> This is a bug report for perl from ThomasKratz@WEB.DE,
> generated with the help of perlbug 1.35 running under perl v5.8.7.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> win32sck.c includes winsock.h (Winsock Version 1.1) and
> ws2spi.h (Winsock version 2.0). The latter includes winsock2.h.
> 
> The IP_ constants for winsock2.h are in ws2tcpip.h which is not
>    included
> anywhere.
> 
> If you now try to include ws2tcpip.h for another module
> (I needed it for IO::Socket::Multicast) you will get an error
> stating that a struct ip_mqreq is redefined, which is correct,
> because it is already defined in winsock.h
> (included via perl.h and sys/socket.h)
> 
> As far as I can judge *either* winsock.h *or* winsock2.h should be
>    used.
> Not a mixture of both.
> 
> Thomas
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=high
> ---
> Site configuration information for perl v5.8.7:
> 
> Configured by TOMK at Fri Nov 18 11:04:41 2005.
> 
> Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
>   Platform:
>     osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
>     uname=''
>     config_args='undef'
>     hint=recommended, useposix=true, d_sigaction=undef
>     usethreads=define use5005threads=undef useithreads=define
>    usemultiplicity=define
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
>    -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
>    -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
>     optimize='-MD -Zi -DNDEBUG -O1',
>     cppflags='-DWIN32'
>     ccversion='12.00.8168', gccversion='', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8,
>    Off_t='__int64', lseeksize=8
>     alignbytes=8, prototype=define
>   Linker and Libraries:
>     ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
>    -libpath:"c:\perl\lib\CORE"  -machine:x86'
>     libpth=\lib
>     libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
>    comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
>    netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib
>    odbc32.lib odbccp32.lib msvcrt.lib
>     perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib
>    winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib
>    oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
>    version.lib odbc32.lib odbccp32.lib msvcrt.lib
>     libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
>     gnulibc_version='undef'
>   Dynamic Linking:
>     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
>    -opt:ref,icf  -libpath:"c:\perl\lib\CORE"  -machine:x86'
> 
> Locally applied patches:
> 
> 
> ---
> @INC for perl v5.8.7:
>     c:/perl/lib
>     c:/perl/site/lib
>     .
> 
> ---
> Environment for perl v5.8.7:
>     CYGWIN=ntsec tty
>     HOME=%HOMEDRIVE%%HOMEPATH%
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>    
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;P:\ABT\SIRONCS\PROD\BIN;P:\ABT\ZEIDON32.RUN\BIN;C:\Programme\Microsoft
>    SQL
>   
Server\80\Tools\BINN;C:\Programme\Reflection;C:\NUTCROOT\bin;C:\NUTCROOT\bin\x11;C:\NUTCROOT\mksnt;D:\Programme\Support
>   
Tools\;D:\Programme\Subversion\bin;D:\programme\cygwin\bin;C:\Programme\Reuters\Common\Login;C:\Programme\Reuters\TIBRV\BIN;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\Programme\Microsoft
>    Visual Studio\Common\Tools\WinNT;C:\Programme\Microsoft Visual
>    Studio\Common\MSDev98\Bin;C:\Programme\Microsoft Visual
>    Studio\Common\Tools;C:\Programme\Microsoft Visual
>    Studio\VC98\bin;c:\perl\bin
>     PERL_BADLANG (unset)
>     SHELL=C:\NUTCROOT\mksnt\sh.exe
> 
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
> 
> 
> 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About