develooper Front page | perl.perl5.porters | Postings from December 2001

Re: it won't compile on win32

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
December 29, 2001 07:23
Subject:
Re: it won't compile on win32
Message ID:
20011229152331.15967.4@bactrian.ni-s.u-net.com
Nicholas Clark <nick@unfortu.net> writes:
>On Fri, Dec 28, 2001 at 06:15:14PM +0100, Nikola Knezevic wrote:
>> As subject says, perl won't compile on Win32. AFAIK, it behaves like
>> this last two-three days. For the time before that, I can't guarantee.
>> 
>> 
>> MACHID: K5 W95,AMD K5,Win95,4NT,VC5 SP3
>> Smoking patch 13915
>> 
>> 
>> Configuration: CFG=Debug USE_PERLCRT=define USE_MULTI=define USE_ITHREADS=define USE_IMP_SYS=define
>
>I think it's the IMP_SYS that's triggering the problem. But the problem was
>caused by me. Sorry. (patch at end)
>
>If I try buidling with -DIMP_SYS on FreeBSD or Linux I get this
>
>`sh  cflags "optimize='-O'" libperl.a perl.o`  perl.c
>          CCCMD =  cc -DPERL_CORE -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include -DPERL_IMPLICIT_SYS -O -Wall 
>In file included from perl.h:2122,
>                 from perl.c:16:
>iperlsys.h:449: warning: `struct utsname' declared inside parameter list
>iperlsys.h:449: warning: its scope is only this definition or declaration, which is probably not what you want.
>iperlsys.h:618: warning: `struct utimbuf' declared inside parameter list
>iperlsys.h:1102: syntax error before `*'
>iperlsys.h:1102: syntax error before `SOCKET'
>iperlsys.h:1103: warning: type defaults to `int' in declaration of `SOCKET'
>iperlsys.h:1103: `SOCKET' declared as function returning a function
>iperlsys.h:1153: `LPSocket' declared as function returning a function
>iperlsys.h:1166: syntax error before `LPAccept'
>
>Line 1102 (the first fatal line) is:
>
>typedef SOCKET		(*LPAccept)(struct IPerlSock*, SOCKET,
>			    struct sockaddr*, int*);
>
>where should SOCKET be defined?

SOCKET is a Win32-ism 
In its <winsock.h> it is typedef-ed to u_int.
It is basically a numeric file descriptor but in a space disjoint 
(maybe) from normal open() type fds.

Suggest you try:

#ifndef WIN32
#define SOCKET int
#endif  


>
>
>> ...\pp_sys.c(2318) : error C2198: 'Perl_my_socketpair' : too few actual parameters
>> ...\pp_sys.c(2318) : warning C4024: 'Perl_my_socketpair' : different types for formal and actual parameter 1
>> ...\pp_sys.c(2318) : warning C4024: 'Perl_my_socketpair' : different types for formal and actual parameter 4
>> ...\pp_sys.c(2318) : warning C4047: 'function' : 'int ' differs in levels of indirection from 'int [2]'
>> ...\pp_sys.c(2318) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int '
>> NMAKE : fatal error U1077: 'd:\DevStudio\VC\BIN\cl.exe' : return code '0x2'
>>  Unable to make perl in this configuration
>
>
>Patch to embed.pl - I didn't realise that I needed an n flag.
>You'll need to re-run embed.pl to make embed.h before re-building. This doesn't
>happen automatically.
>
>Nicholas Clark
>
>--- embed.pl.orig	Tue Dec 25 17:00:47 2001
>+++ embed.pl	Sat Dec 29 13:42:58 2001
>@@ -2354,7 +2354,7 @@
> Apd	|char*	|sv_2pv_flags	|SV* sv|STRLEN* lp|I32 flags
> Ap	|char*	|my_atof2	|const char *s|NV* value
> #if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
>-Ap	|int	|my_socketpair	|int family|int type|int protocol|int fd[2]
>+Apn	|int	|my_socketpair	|int family|int type|int protocol|int fd[2]
> #endif
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


Thread Previous | 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