From f9d625cd420cfb80ebe062541aa8812057b10117 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Thu, 13 Feb 2014 11:07:56 +1100 Subject: [PATCH] add #define PERL_NO_GET_CONTEXT to ParseXS's pods 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 | 8 ++++++-- dist/ExtUtils-ParseXS/lib/perlxstut.pod | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/ExtUtils-ParseXS/lib/perlxs.pod b/dist/ExtUtils-ParseXS/lib/perlxs.pod index 12e2227..0e9c84e 100644 --- a/dist/ExtUtils-ParseXS/lib/perlxs.pod +++ b/dist/ExtUtils-ParseXS/lib/perlxs.pod @@ -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, C, and C, 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). 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: Interface to some ONC+ RPC bind library functions. + #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" diff --git a/dist/ExtUtils-ParseXS/lib/perlxstut.pod b/dist/ExtUtils-ParseXS/lib/perlxstut.pod index 829e714..2f33273 100644 --- a/dist/ExtUtils-ParseXS/lib/perlxstut.pod +++ b/dist/ExtUtils-ParseXS/lib/perlxstut.pod @@ -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. This is all we need: #define PERLIO_NOT_STDIO 0 + #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" -- 2.7.4