more fixes for old perl versions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8777 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
774a40c822
commit
16d3c24fa2
2 changed files with 27 additions and 2 deletions
|
|
@ -90,6 +90,7 @@ extern "C" {
|
||||||
#include "EXTERN.h"
|
#include "EXTERN.h"
|
||||||
#include "perl.h"
|
#include "perl.h"
|
||||||
#include "XSUB.h"
|
#include "XSUB.h"
|
||||||
|
#include "patchlevel.h"
|
||||||
|
|
||||||
#ifndef pTHX_
|
#ifndef pTHX_
|
||||||
#define pTHX_
|
#define pTHX_
|
||||||
|
|
@ -173,8 +174,32 @@ typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *);
|
||||||
# define SvUOK(sv) SvIOK_UV(sv)
|
# define SvUOK(sv) SvIOK_UV(sv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PL_markstack_ptr
|
/* Salvador's workaround for bug in perl 5.6.x croak and below*/
|
||||||
|
#if !defined(PERL_VERSION) || (PERL_VERSION < 8)
|
||||||
|
# ifdef PERL_OBJECT
|
||||||
|
# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
|
||||||
|
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
|
||||||
|
# else
|
||||||
|
static void SWIG_croak_null()
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
SV *err=ERRSV;
|
||||||
|
# if !defined(PERL_VERSION) || (PERL_VERSION < 6)
|
||||||
|
croak("%_", err);
|
||||||
|
# else
|
||||||
|
if (SvOK(err) && !SvROK(err)) croak("%_", err);
|
||||||
|
croak(Nullch);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define SWIG_croak_null() croak(Nullch)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Fix for old Perls (except 5.005_04...) */
|
||||||
|
#if !((PATCHLEVEL == 5) && (SUBVERSION == 4))
|
||||||
|
# ifndef PL_markstack_ptr
|
||||||
# define PL_markstack_ptr Perl_markstack_ptr
|
# define PL_markstack_ptr Perl_markstack_ptr
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(PERL_REVISION) || ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
|
#if !defined(PERL_REVISION) || ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
|
||||||
|
|
|
||||||
|
|
@ -725,7 +725,7 @@ public:
|
||||||
"XSRETURN(argvi);\n",
|
"XSRETURN(argvi);\n",
|
||||||
"fail:\n",
|
"fail:\n",
|
||||||
cleanup,
|
cleanup,
|
||||||
"croak(Nullch);\n"
|
"SWIG_croak_null();\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"}\n",
|
"}\n",
|
||||||
NIL);
|
NIL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue