Dan Sugalski <[EMAIL PROTECTED]> writes:
>At 10:35 AM 10/5/00 -0800, Michael wrote:
>>in my Module.xs file there is the declaration
>>     CODE:
>>         printf("# destroying %s\n", SvPV(ST(0),na) );
>>         safefree( (char*)self );
>>
>>I get this error???? any clues would be appreciated
>>
>>`na' undeclared (first use in this function)
>
>na was renamed PL_na as of 5.005. There was a backwards-compatibility 
>#define in the 5.005 tree to make na be PL_na, but that went away by 
>default as of 5.6.0. Either change the na to PL_na (which would be best) or 
>turn on pollution in the makefile step. (How is left as an exercise for the 
>reader, since it's really not the best way to do it)

Better yet:

A. use SvPV_nolen()
B. Declare your own 
   STRLEN na;

The reason these are better is that accessing PL_na involves getting access
to thread-local storage under threads - which is a non-trivial cost for
something you are not using!

(B) is 100% backward compatible.

-- 
Nick Ing-Simmons

Reply via email to