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

Thread.xs on win32

From:
Peter Prymmer
Date:
June 29, 2001 16:11
Subject:
Thread.xs on win32
Message ID:
Pine.OSF.4.10.10106291522160.65853-100000@aspara.forte.com

Three days ago I reported a workaround that let Thread.xs compile
under MS VC 5 on NT 4 in:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-06/msg01573.html

But this morning I realized that I had mistakenly thought that there
was but one function call there.  There are two. With experimentation
I found that the following type of addition to Thread.xs (at least as it
appeared under perl@10930 - it might have changed recently?) would suffice
to let Thread.xs compile and to let ext/Thread/Thread.t to run all tests
as well as can be expected:

--- perl_10930/ext/Thread/Thread.xs.orig	Fri Jun 29 16:03:46 2001
+++ perl_10930/ext/Thread/Thread.xs	Fri Jun 29 16:05:04 2001
@@ -349,7 +349,11 @@
      */
     DEBUG_S(PerlIO_printf(Perl_debug_log,
 	    "handle_thread_signal: got signal %d\n", sig););
+#ifdef WIN32
+  /* rec-casting/porting needed:   write(sig_pipe[1], &c, 1); */
+#else
     write(sig_pipe[1], &c, 1);
+#endif
 }
 
 MODULE = Thread		PACKAGE = Thread
End of half-patch.

In other words it is only the call to write() that the compiler
complains about on win32.  With that applied the 10930 kit will
compile and test all ok except for POSIX.t test #2.

Indeed it may be that that call could be
resurrected/ported/arguments-re-cast since the error messages seen without
that "half-patch" appear to be casting/prototype-mismatch errors:

        cl -c  -nologo -Gf -W3 -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_IMPLICIT_CONTEXT -DPERL_
IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -O1 -MD -DNDEBUG    -DVERSION=\"1.0\"  -DXS_VERSION=\"1.0\"  -
I..\..\lib\CORE  Thread.c
Thread.c
Thread.xs(352) : error C2065: 'my_perl' : undeclared identifier
Thread.xs(352) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int
 '
Thread.xs(352) : warning C4024: 'Perl_ILIO_ptr' : different types for formal and actual parameter 1
Thread.xs(352) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int
 '
Thread.xs(352) : warning C4024: 'Perl_ILIO_ptr' : different types for formal and actual parameter 1
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

Hopefully someone with access to that type of compiler will be able to
take matters forward (I'm outta here).

Peter Prymmer








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