Hi,

Back from unwellness and the subsequent need to catch up with a stack of
stuff, I finally found time to sync up my parrot tree and try a Win32 build.
Turns out it fails in event.c with a whole string of errors and warnings:-

events.c(67) : error C2061: syntax error : identifier 'sig_int'
events.c(67) : error C2059: syntax error : ';'
events.c(104) : error C2065: 'sig_int' : undeclared identifier
events.c(216) : warning C4013: 'pipe' undefined; assuming extern returning
int
events.c(564) : error C2065: 'fd_set' : undeclared identifier
events.c(564) : error C2146: syntax error : missing ';' before identifier
'rfds'
events.c(564) : error C2065: 'rfds' : undeclared identifier
events.c(564) : error C2065: 'wfds' : undeclared identifier
events.c(565) : error C2143: syntax error : missing ';' before 'type'
events.c(566) : error C2143: syntax error : missing ';' before 'type'
events.c(568) : warning C4013: 'FD_ZERO' undefined; assuming extern
returning int
events.c(573) : warning C4013: 'FD_SET' undefined; assuming extern returning
int
events.c(574) : error C2065: 'n_highest' : undeclared identifier
events.c(580) : error C2065: 'running' : undeclared identifier
events.c(581) : warning C4013: 'select' undefined; assuming extern returning
int
events.c(600) : warning C4013: 'FD_ISSET' undefined; assuming extern
returning int
events.c(838) : warning C4244: '=' : conversion from 'double ' to 'long ',
possible loss of data
    (paths stripped for readability)

The main issues look to be pipes and signals.  These things just work
differently on Win32 - or at least, the way you get at their functionality
is somewhat different.

PIPES
My only experience of working with pipes in Win32 has been using the native
pipe APIs.  Anyway, I had a look at what is used in Parrot.  Firstly, the
pipe function does not appear to be defined.  One with similar functionality
called _pipe is.  However, it takes another two parameters; the size of the
buffer for the pipe data and a flag for whether the pipe is in text or
binary mode.  Details here:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__pipe.asp
It looks like things like fd_set don't deal with pipes here either, just
sockets; see:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/fd_set_2.asp

SIGNALS
There is a signal function:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_signal.asp
You set up a signal handler and it's called when the signal is raised.
There are a few issues, though.  For example, SIGINT is "not supported for
Win32 apps", but when one is received a new thread is spawned to handle the
signal.  SIGILL, SIGSEGV and SIGTERM are not generated under WinNT (e.g. NT,
2k, XP) though you can explicitly generate them by calling raise.  There are
various things you should not do in a signal handler too - use I/O
functions, allocate memory from the heap, etc.  It's all in the document in
not-so-glorious detail.

Hope this is helpful, and I'd more than welcome any corrections from
Win32-ers more experienced in these matters than I.  :-)

Jonathan


Reply via email to