Fixed typecheck for std::complex<double>
which was previously broken. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9817 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
211ee4eb0a
commit
cf0e8cca5a
1 changed files with 4 additions and 3 deletions
|
|
@ -65,8 +65,8 @@ SWIG_AsVal(Type) (VALUE o, Type* val)
|
||||||
double im = 0;
|
double im = 0;
|
||||||
SWIG_AsVal_double( imag, &im );
|
SWIG_AsVal_double( imag, &im );
|
||||||
*val = Constructor(re, im);
|
*val = Constructor(re, im);
|
||||||
return SWIG_OK;
|
|
||||||
}
|
}
|
||||||
|
return SWIG_OK;
|
||||||
} else {
|
} else {
|
||||||
double d;
|
double d;
|
||||||
int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d));
|
int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d));
|
||||||
|
|
@ -96,7 +96,8 @@ SWIG_AsVal(Type)(VALUE o, Type *val)
|
||||||
SWIG_AsVal_double( real, &re );
|
SWIG_AsVal_double( real, &re );
|
||||||
double im = 0;
|
double im = 0;
|
||||||
SWIG_AsVal_double( imag, &im );
|
SWIG_AsVal_double( imag, &im );
|
||||||
if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) {
|
if ((-FLT_MAX <= re && re <= FLT_MAX) &&
|
||||||
|
(-FLT_MAX <= im && im <= FLT_MAX)) {
|
||||||
if (val) *val = Constructor(%numeric_cast(re, float),
|
if (val) *val = Constructor(%numeric_cast(re, float),
|
||||||
%numeric_cast(im, float));
|
%numeric_cast(im, float));
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue