summaryrefslogtreecommitdiff
path: root/Lib/perl5
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-01-18 15:36:37 +1300
committerOlly Betts <ojwbetts@gmail.com>2022-01-19 10:07:30 +1300
commit748a9a5452568b90edba7162e5b9376d4837529d (patch)
treedb5ba4ea6ef1393b57b1622e5e1abfe111bbd2b6 /Lib/perl5
parent8c608d646c611820ad58c85315f23b4499331de7 (diff)
downloadswig-748a9a5452568b90edba7162e5b9376d4837529d.tar.gz
[perl] Require at least Perl 5.8.0
As discussed and agreed in #1629, it's become hard to test with Perl 5.6 or earlier, such old versions are no longer in active use, and 4.1.0 is an appropriate time to make such a change. I've dropped the compatibility code that was obvious to me, but there's probably more that can be cleaned up now.
Diffstat (limited to 'Lib/perl5')
-rw-r--r--Lib/perl5/perlhead.swg28
-rw-r--r--Lib/perl5/perlinit.swg4
-rw-r--r--Lib/perl5/perlrun.swg60
3 files changed, 13 insertions, 79 deletions
diff --git a/Lib/perl5/perlhead.swg b/Lib/perl5/perlhead.swg
index 5437af5a5..bb7c1741d 100644
--- a/Lib/perl5/perlhead.swg
+++ b/Lib/perl5/perlhead.swg
@@ -8,22 +8,9 @@ extern "C" {
#include "perl.h"
#include "XSUB.h"
-/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
-
-/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
-#ifndef PERL_REVISION
-# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
-# define PERL_PATCHLEVEL_H_IMPLICIT
-# include <patchlevel.h>
-# endif
-# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
-# include <could_not_find_Perl_patchlevel.h>
-# endif
-# ifndef PERL_REVISION
-# define PERL_REVISION (5)
-# define PERL_VERSION PATCHLEVEL
-# define PERL_SUBVERSION SUBVERSION
-# endif
+/* PERL_REVISION was added in Perl 5.6. */
+#if !defined PERL_REVISION || (PERL_REVISION-0 == 5 && PERL_VERSION-0 < 8)
+# error SWIG requires Perl >= 5.8.0
#endif
#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
@@ -38,15 +25,6 @@ extern "C" {
# define SvUOK(sv) SvIOK_UV(sv)
#endif
-#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
-# define PL_sv_undef sv_undef
-# define PL_na na
-# define PL_errgv errgv
-# define PL_sv_no sv_no
-# define PL_sv_yes sv_yes
-# define PL_markstack_ptr markstack_ptr
-#endif
-
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
diff --git a/Lib/perl5/perlinit.swg b/Lib/perl5/perlinit.swg
index b49040d26..c26b93fad 100644
--- a/Lib/perl5/perlinit.swg
+++ b/Lib/perl5/perlinit.swg
@@ -4,15 +4,11 @@
#ifdef __cplusplus
extern "C"
#endif
-#ifndef PERL_OBJECT
#ifndef MULTIPLICITY
SWIGEXPORT void SWIG_init (CV* cv);
#else
SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
#endif
-#else
-SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
-#endif
%}
/* Module initialization function */
diff --git a/Lib/perl5/perlrun.swg b/Lib/perl5/perlrun.swg
index b04002f5d..28703d1a6 100644
--- a/Lib/perl5/perlrun.swg
+++ b/Lib/perl5/perlrun.swg
@@ -6,13 +6,8 @@
* type checking.
* ----------------------------------------------------------------------------- */
-#ifdef PERL_OBJECT
-#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
-#define SWIG_PERL_OBJECT_CALL pPerl,
-#else
#define SWIG_PERL_OBJECT_DECL
#define SWIG_PERL_OBJECT_CALL
-#endif
/* Common SWIG API */
@@ -88,32 +83,12 @@ extern "C" {
#endif
/* Macro to call an XS function */
-#ifdef PERL_OBJECT
-# define SWIG_CALLXS(_name) _name(cv,pPerl)
-#else
-# ifndef MULTIPLICITY
-# define SWIG_CALLXS(_name) _name(cv)
-# else
-# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
-# endif
-#endif
-
-#ifdef PERL_OBJECT
-#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
-#ifdef __cplusplus
-}
+#ifndef MULTIPLICITY
+# define SWIG_CALLXS(_name) _name(cv)
+#else
+# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
#endif
-#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
-#define SWIGCLASS_STATIC
-
-#else /* PERL_OBJECT */
-
#define MAGIC_PPERL
#define SWIGCLASS_STATIC static SWIGUNUSED
@@ -141,24 +116,14 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
#endif
#endif /* MULTIPLICITY */
-#endif /* PERL_OBJECT */
-# ifdef PERL_OBJECT
-# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
-static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl)
-# else
static void SWIGUNUSED SWIG_croak_null()
-# endif
{
SV *err = get_sv("@", GV_ADD);
-# if (PERL_VERSION < 6)
- croak("%_", err);
-# else
if (sv_isobject(err))
croak(0);
else
croak("%s", SvPV_nolen(err));
-# endif
}
@@ -462,20 +427,15 @@ typedef struct {
} swig_variable_info;
/* Magic variable code */
-#ifndef PERL_OBJECT
-# ifdef __cplusplus
+#ifdef __cplusplus
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
-# else
+#else
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
-# endif
-# ifndef MULTIPLICITY
-SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
-# else
-SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
-# endif
+#endif
+#ifndef MULTIPLICITY
+SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
#else
-# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
-SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
+SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
#endif
{
MAGIC *mg;