PL_na issues (was ANNOUNCE: 5.005_58 perldelta page) 
Author Message
 PL_na issues (was ANNOUNCE: 5.005_58 perldelta page)

what is the recommended c preprozessor conditional to switch between na
and PL_na resp. the old POLLUTEd and the new 5.006 names?

i want to keep the XSUBs for older perl version, but want to fix them
for 5.006.
for now i used this in all older xs module code

#ifdef PATCHLEVEL
  // old xs code with na, ...
#else
  // fixed to PL_na, localized it, added dTHR, ...
#endif

but patchlevel.h could be manually included (which would fail then) and
it is not so obvious. i couldn't find a meaningful POLLUTE definition
for a conditional.
#if ((PERL_SUBVERSION > 5) ||
     ((PERL_SUBVERSION == 5) && (PERL_REVISION >= 58)))

could also be used. but this is a bit too hard to recommend for every
XSUB writer.

i don't want to use perl Makefile.PL POLLUTE=1, because i want to fix
the xs code directly to adopt the new names.

--                                        
Reini



Fri, 18 Jan 2002 03:00:00 GMT  
 PL_na issues (was ANNOUNCE: 5.005_58 perldelta page)
[mailed & posted]

Quote:

>what is the recommended c preprozessor conditional to switch between na
>and PL_na resp. the old POLLUTEd and the new 5.006 names?

The "recommended" solution is *not* to use "na" at all but to define a
local variable, like:

    STRLEN n_a;

and use that instead. The reason is that PL_na under threaded Perl becomes
a per-thread variable.  You'll then need to add a dTHR definition to your
function to access PL_na, which will be an expensive access to
thread-local storage.  Adding a local STRLEN variable is cheap, backward
compatible and doesn't need preprocessor conditionals.  It is also what is
being used in the Perl core.

-Jan



Fri, 18 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. from paradox to pervasive SQL 7

2. ANNOUNCE: 5.005_58 perldelta page

3. ANNOUNCE: PerlMonth - Issue 2

4. ANNOUNCE: PerlMonth - Issue 3

5. DOC: perldelta.pod for 5.005_55

6. Newbie (probably stupid) question: Improved qw operator in perldelta

7. Show .Gif's?

8. Strange behaviour of SetRange

9. filtering deleted dbase records

10. how to delete files in pascal?

11. How to declare Cursor in Interbase

12. ANNOUNCE: SpiffyCounter 0.25 (Counter+XBM Ticker+Page Statistics)

 

 
Powered by phpBB® Forum Software