Allow avoiding generation of unwanted std::complex<T> typemaps
In many cases, only one of std::complex<double> and std::complex<float> is used, so while we continue to define typemaps for both by default, for compatibility with the other modules, add a possibility to avoid generating the code for the unwanted specialization by predefining the corresponding SWIG_NO_STD_COMPLEX_$TYPE before including this file.
This commit is contained in:
parent
95aa3d9389
commit
03f229b314
1 changed files with 8 additions and 0 deletions
|
|
@ -50,5 +50,13 @@ public:
|
|||
%template(Complex_##T) std::complex<T>;
|
||||
%enddef
|
||||
|
||||
// By default, typemaps for both std::complex<double> and std::complex<float>
|
||||
// are defined, but one of them can be disabled by predefining the
|
||||
// corresponding symbol before including this file.
|
||||
#ifndef SWIG_NO_STD_COMPLEX_DOUBLE
|
||||
swig_complex_typemaps(double)
|
||||
#endif
|
||||
|
||||
#ifndef SWIG_NO_STD_COMPLEX_FLOAT
|
||||
swig_complex_typemaps(float)
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue