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&,
long, unsigned long, signed long,
short, unsigned short,signed short,
long long, unsigned long long,
unsigned char, signed char,
long&, unsigned long&, signed long&,
short&, unsigned short&, signed short&,
long long&, unsigned long long&,
unsigned char&, signed char&,
long long, unsigned long long,
unsigned char, signed char,
long&, unsigned long&, signed long&,
short&, unsigned short&, signed short&,
long long&, unsigned long long&,
unsigned char&, signed char&,
size_t, size_t&,
ptrdiff_t, ptrdiff_t& {
char obj[20];
sprintf(obj, "%d", $1);
%raise(obj, "$type", $descriptor);
SwigScilabRaiseEx(obj, "$type", $descriptor);
}
%typemap(throws, noblock=1) enum SWIGTYPE {
char obj[20];
sprintf(obj, "%d", $1);
%raise(obj, "$type", $descriptor);
SwigScilabRaiseEx(obj, "$type", $descriptor);
}
%typemap(throws, noblock=1) float, double,
float&, double& {
float&, double& {
char obj[20];
sprintf(obj, "%5.3f", $1);
%raise(obj, "$type", $descriptor);
SwigScilabRaiseEx(obj, "$type", $descriptor);
}
%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] {
%raise($1, "$type", $descriptor);
SwigScilabRaiseEx($1, "$type", $descriptor);
}
%typemap(throws, noblock=1) char, char& {
char obj[1];
sprintf(obj, "%c", $1);
%raise(obj, "$type", $descriptor);
SwigScilabRaiseEx(obj, "$type", $descriptor);
}
%typemap(throws, noblock=1) SWIGTYPE,
SWIGTYPE*,
SWIGTYPE [ANY],
SWIGTYPE & {
%raise((char*)NULL, "$type", $descriptor);
SwigScilabRaiseEx((char*)NULL, "$type", $descriptor);
}
%typemap(throws, noblock=1) (...) {

View file

@ -235,7 +235,7 @@ SWIG_Scilab_ErrorMsg(int code, const char *msg)
#define SWIG_fail return SWIG_ERROR;
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 (obj)
Scierror(999, "Exception (%s) occured: %s\n", type, obj);