From 863369cc411252b52b2a9feb5442b8fde228d202 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 7 Feb 2006 17:37:13 +0000 Subject: [PATCH] simplify output via macro SWIG_ArgError git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8737 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/swigrun.swg | 1 + Lib/typemaps/swigtypemaps.swg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/swigrun.swg b/Lib/swigrun.swg index 2b82c25bf..edfd26824 100644 --- a/Lib/swigrun.swg +++ b/Lib/swigrun.swg @@ -131,6 +131,7 @@ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) /* The CastRankLimit says how many bits are used for the cast rank */ #define SWIG_CASTRANKLIMIT (1 << 8) diff --git a/Lib/typemaps/swigtypemaps.swg b/Lib/typemaps/swigtypemaps.swg index e78c53afc..75886c753 100644 --- a/Lib/typemaps/swigtypemaps.swg +++ b/Lib/typemaps/swigtypemaps.swg @@ -133,7 +133,7 @@ * ----------------------------------------------------------------------------- */ #define %error_block(Block...) %block(Block) -#define %default_code(code) ((code != SWIG_ERROR) ? code : SWIG_TypeError) +#define %default_code(code) SWIG_ArgError(code) #define %argument_fail(code, type, name, argn) SWIG_exception_fail(%default_code(code), %argfail_fmt(type, name, argn)) #define %argument_nullref(type, name, argn) SWIG_exception_fail(SWIG_ValueError, %argnullref_fmt(type, name, argn)) #define %variable_fail(code, type, name) SWIG_exception_fail(%default_code(code), %varfail_fmt(type, name))