develooper Front page | perl.perl5.porters | Postings from February 2000

Re: Tk 800.018 Build failure on Perl 5.5.640 (MSWin32-x86-multi-thread)

Gurusamy Sarathy
February 9, 2000 14:54
Re: Tk 800.018 Build failure on Perl 5.5.640 (MSWin32-x86-multi-thread)
Message ID:
On Wed, 09 Feb 2000 22:29:40 GMT, Nick Ing-Simmons wrote:
>Paul Moore <> writes:
>>I'm trying to build Tk800.018 under Perl 5.5.640. I've built Perl on Win32,
>>using MSVC 6 with the USE_MULTI/USE_ITHREADS/USE_IMP_SYS options (basically, the
>>new fork emulation on Win32). The build failed with errors in tkGlue.c. The
>>errors are attached - looking at cop.h, there is a specific difference under
>>USE_ITHREADS. I don't know how to fix it, unfortunately :-)
>Hmm, the code in question is attempting to set cop_stash to NULL
>before looking up a symbolic reference. I cannot remember why 
>it does that - it has something to do with making 
>  -textvariable => 'Foo',
>Get what "someone" thought was the "right" package's $Foo.
>Note that \$Foo or 'Where::Foo' should work fine , it is just 
>unqualified symrefs that are affected.
>Thus if you are doing using unqualifed symrefs a
>#if 0
>round that if (SvPOK()) 
>should work round the issue.

Here's a somewhat better fix.  You'll need to #define default Cop*
macros in a Tk header somewhere for the sake of older versions:

    #ifndef CopSTASH
    #  define CopSTASH(c)		c->cop_stash
    #  define CopSTASH_set(c,h)		(CopSTASH(c) = h)

I'd eventually like to replace the need for peeking into PL_curcop
(and indeed, *any* global inside perl) with real functions in the
API that fit that need.  Suggestions/patches for these welcome.

--- ./Tk/tkGlue.c.~1~	Wed Feb  9 14:40:39 2000
+++ Tk/tkGlue.c	Wed Feb  9 14:40:39 2000
@@ -3890,12 +3890,16 @@
  else if (SvPOK(sv))
-   HV *old_stash = PL_curcop->cop_stash;
+   HV *old_stash = CopSTASH(PL_curcop);
    char *name;
    SV *x = NULL;
    int prefix = '?';
    name = SvPV(sv,na);
-   PL_curcop->cop_stash = NULL;
+   CopSTASHPV(PL_curcop) = NULL;
+   CopSTASH(PL_curcop) = NULL;
    switch (type)
@@ -3919,7 +3923,7 @@
       prefix = '%';
-   PL_curcop->cop_stash = old_stash;
+   CopSTASH_set(PL_curcop, old_stash);
    if (x)
      *vp = SvREFCNT_inc(x);
End of Patch. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About