scilab: fix SwigScilabRaise compilation error on examples

This commit is contained in:
Simon Marchetto 2014-04-07 18:03:25 +02:00
commit b21afc2128
2 changed files with 15 additions and 15 deletions

View file

@ -6,51 +6,51 @@
int&,unsigned int&, signed int&, int&,unsigned int&, signed int&,
long, unsigned long, signed long, long, unsigned long, signed long,
short, unsigned short,signed short, short, unsigned short,signed short,
long long, unsigned long long, long long, unsigned long long,
unsigned char, signed char, unsigned char, signed char,
long&, unsigned long&, signed long&, long&, unsigned long&, signed long&,
short&, unsigned short&, signed short&, short&, unsigned short&, signed short&,
long long&, unsigned long long&, long long&, unsigned long long&,
unsigned char&, signed char&, unsigned char&, signed char&,
size_t, size_t&, size_t, size_t&,
ptrdiff_t, ptrdiff_t& { ptrdiff_t, ptrdiff_t& {
char obj[20]; char obj[20];
sprintf(obj, "%d", $1); sprintf(obj, "%d", $1);
%raise(obj, "$type", $descriptor); SwigScilabRaiseEx(obj, "$type", $descriptor);
} }
%typemap(throws, noblock=1) enum SWIGTYPE { %typemap(throws, noblock=1) enum SWIGTYPE {
char obj[20]; char obj[20];
sprintf(obj, "%d", $1); sprintf(obj, "%d", $1);
%raise(obj, "$type", $descriptor); SwigScilabRaiseEx(obj, "$type", $descriptor);
} }
%typemap(throws, noblock=1) float, double, %typemap(throws, noblock=1) float, double,
float&, double& { float&, double& {
char obj[20]; char obj[20];
sprintf(obj, "%5.3f", $1); sprintf(obj, "%5.3f", $1);
%raise(obj, "$type", $descriptor); SwigScilabRaiseEx(obj, "$type", $descriptor);
} }
%typemap(throws, noblock=1) bool, bool& { %typemap(throws, noblock=1) bool, bool& {
%raise($1 ? "true" : "false", "$type", $descriptor); SwigScilabRaiseEx($1 ? "true" : "false", "$type", $descriptor);
} }
%typemap(throws, noblock=1) char*, char[ANY] { %typemap(throws, noblock=1) char*, char[ANY] {
%raise($1, "$type", $descriptor); SwigScilabRaiseEx($1, "$type", $descriptor);
} }
%typemap(throws, noblock=1) char, char& { %typemap(throws, noblock=1) char, char& {
char obj[1]; char obj[1];
sprintf(obj, "%c", $1); sprintf(obj, "%c", $1);
%raise(obj, "$type", $descriptor); SwigScilabRaiseEx(obj, "$type", $descriptor);
} }
%typemap(throws, noblock=1) SWIGTYPE, %typemap(throws, noblock=1) SWIGTYPE,
SWIGTYPE*, SWIGTYPE*,
SWIGTYPE [ANY], SWIGTYPE [ANY],
SWIGTYPE & { SWIGTYPE & {
%raise((char*)NULL, "$type", $descriptor); SwigScilabRaiseEx((char*)NULL, "$type", $descriptor);
} }
%typemap(throws, noblock=1) (...) { %typemap(throws, noblock=1) (...) {

View file

@ -235,7 +235,7 @@ SWIG_Scilab_ErrorMsg(int code, const char *msg)
#define SWIG_fail return SWIG_ERROR; #define SWIG_fail return SWIG_ERROR;
SWIGRUNTIME int SWIGRUNTIME int
SwigScilabRaise(const char *obj, const char *type, swig_type_info *descriptor) { SwigScilabRaiseEx(const char *obj, const char *type, swig_type_info *descriptor) {
if (type) { if (type) {
if (obj) if (obj)
Scierror(999, "Exception (%s) occured: %s\n", type, obj); Scierror(999, "Exception (%s) occured: %s\n", type, obj);