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:
Vadim Zeitlin 2017-04-15 20:28:30 +02:00
commit 03f229b314

View file

@ -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