add #define PERL_NO_GET_CONTEXT to ParseXS's pods
authorDaniel Dragan <bulk88@hotmail.com>
Thu, 13 Feb 2014 00:07:56 +0000 (11:07 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 16 Feb 2014 22:26:14 +0000 (09:26 +1100)
Not using PERL_NO_GET_CONTEXT is for legacy or unmaintained pre-ithreads
code. New code should define it.

dist/ExtUtils-ParseXS/lib/perlxs.pod
dist/ExtUtils-ParseXS/lib/perlxstut.pod

index 12e2227..0e9c84e 100644 (file)
@@ -109,9 +109,11 @@ C and Perl and so preserves the interface even from Perl.
 This XSUB will be invoked from Perl with the usage shown
 above.  Note that the first three #include statements, for
 C<EXTERN.h>, C<perl.h>, and C<XSUB.h>, will always be present at the
-beginning of an XS file.  This approach and others will be
-expanded later in this document.
+beginning of an XS file.  PERL_NO_GET_CONTEXT should be present to use
+the modern Perl C API.  This approach and others will be expanded later
+in this document.
 
+     #define PERL_NO_GET_CONTEXT
      #include "EXTERN.h"
      #include "perl.h"
      #include "XSUB.h"
@@ -1870,6 +1872,7 @@ the C<-g> (C<--global>) option with h2xs (see L<h2xs>).
 
 Below is an example module that makes use of the macros.
 
+    #define PERL_NO_GET_CONTEXT
     #include "EXTERN.h"
     #include "perl.h"
     #include "XSUB.h"
@@ -2050,6 +2053,7 @@ or even crashes become more likely), nor is it very portable.
 
 File C<RPC.xs>: Interface to some ONC+ RPC bind library functions.
 
+     #define PERL_NO_GET_CONTEXT
      #include "EXTERN.h"
      #include "perl.h"
      #include "XSUB.h"
index 829e714..2f33273 100644 (file)
@@ -146,6 +146,7 @@ the extension.
 
 Finally, the Mytest.xs file should look something like this:
 
+    #define PERL_NO_GET_CONTEXT
     #include "EXTERN.h"
     #include "perl.h"
     #include "XSUB.h"
@@ -1227,6 +1228,7 @@ Suppose that for some strange reason we need a wrapper around the
 standard C library function C<fputs()>. This is all we need:
 
        #define PERLIO_NOT_STDIO 0
+       #define PERL_NO_GET_CONTEXT
        #include "EXTERN.h"
        #include "perl.h"
        #include "XSUB.h"