diff --git a/Lib/perl5/perlrun.swg b/Lib/perl5/perlrun.swg index e7b99db60..552d258e4 100644 --- a/Lib/perl5/perlrun.swg +++ b/Lib/perl5/perlrun.swg @@ -77,6 +77,104 @@ extern "C" { #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL + +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#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 + +/* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */ + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC +#else +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static SWIGUNUSED +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +typedef int (*SwigMagicFunc)(SV *, MAGIC *); + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFuncHack)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + + +#else +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +/* Modifications for newer Perl 5.005 releases */ + +#if !defined(PERL_REVISION) || ((PERL_REVISION >= 5) && ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 50)))) +# ifndef PL_sv_yes +# define PL_sv_yes sv_yes +# endif +# ifndef PL_sv_undef +# define PL_sv_undef sv_undef +# endif +# ifndef PL_na +# define PL_na na +# endif +#endif + +#include + SWIGRUNTIME const char * SWIG_Perl_TypeProxyName(const swig_type_info *type) { if (!type) return NULL; diff --git a/Lib/perl5/perlruntime.swg b/Lib/perl5/perlruntime.swg index 1aed9c4d1..1db3cd8e2 100644 --- a/Lib/perl5/perlruntime.swg +++ b/Lib/perl5/perlruntime.swg @@ -1,104 +1,3 @@ -%insert(runtime) %{ - -#ifdef __cplusplus -/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ -#include -#include -extern "C" { -#endif -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#ifndef pTHX_ -#define pTHX_ -#endif - -#include -#ifdef __cplusplus -} -#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 - -/* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */ - -#ifdef PERL_OBJECT -#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; -typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) -#define SWIGCLASS_STATIC -#else -#define MAGIC_PPERL -#define SWIGCLASS_STATIC static SWIGUNUSED -#ifndef MULTIPLICITY -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) -typedef int (*SwigMagicFunc)(SV *, MAGIC *); - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFuncHack)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - - -#else -#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) -typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#endif -#endif - -#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) -#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) -#endif - -/* Modifications for newer Perl 5.005 releases */ - -#if !defined(PERL_REVISION) || ((PERL_REVISION >= 5) && ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 50)))) -# ifndef PL_sv_yes -# define PL_sv_yes sv_yes -# endif -# ifndef PL_sv_undef -# define PL_sv_undef sv_undef -# endif -# ifndef PL_na -# define PL_na na -# endif -#endif - -#include - -%} - %runtime "swigrun.swg" // Common C API type-checking code %runtime "perlrun.swg" // Perl runtime functions diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 44c54a2d4..84b260f58 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -64,6 +64,9 @@ #define SWIG_POINTER_NOSHADOW SWIG_POINTER_OWN << 1 #define SWIG_POINTER_NEW SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN +/* For backward compatibility only */ +#define SWIG_POINTER_EXCEPTION 0 + #ifdef __cplusplus extern "C" { #if 0 diff --git a/Lib/swigerrors.swg b/Lib/swigerrors.swg index b3871873a..8b4636a23 100644 --- a/Lib/swigerrors.swg +++ b/Lib/swigerrors.swg @@ -1,8 +1,4 @@ /* Errors in SWIG */ - -#define SWIG_OK 0 -#define SWIG_ERROR -1 - #define SWIG_MemoryError 1 #define SWIG_IOError 2 #define SWIG_RuntimeError 3 diff --git a/Lib/swigrun.swg b/Lib/swigrun.swg index 7b8c079ff..1dc9f02d2 100644 --- a/Lib/swigrun.swg +++ b/Lib/swigrun.swg @@ -51,6 +51,12 @@ #define SWIG_OLDOBJ 1 #define SWIG_NEWOBJ 2 + +/* Flags for returning states */ +#define SWIG_OK 0 +#define SWIG_ERROR -1 + + #include #ifdef __cplusplus