for clarity and for easier maintainance. pyrun.swg almost the same than 1.3.20, therefore there will be compatible again. code generated is reduced by the use and reuse of %fragments. as usual, all the test-suite is compiling and a much bigger "test project" too. with the new typemaps definition should be much eaiser and uniform add stl/std and user types. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
42 lines
833 B
OpenEdge ABL
42 lines
833 B
OpenEdge ABL
#ifndef __python_ccomplex_i__
|
|
#define __python_ccomplex_i__
|
|
|
|
%include "complex_common.i"
|
|
|
|
/*
|
|
* C complex wrap
|
|
* ISO C99: 7.3 Complex arithmetic <complex.h>
|
|
*/
|
|
|
|
%{
|
|
#include <complex.h>
|
|
%}
|
|
|
|
/*
|
|
*** swig workaround ***
|
|
the %{}% around these typedefs must be removed once
|
|
swig parser supports 'float complex'...
|
|
*/
|
|
%{
|
|
typedef float complex float_complex;
|
|
typedef double complex double_complex;
|
|
%}
|
|
|
|
/* C complex constructor */
|
|
#define CCplxConst(r, i) ((r) + I*(i))
|
|
|
|
%swig_cplxflt_conv(float_complex, CCplxFlt,
|
|
CCplxConst, creal, cimag);
|
|
|
|
%swig_cplxdbl_conv(double_complex, CCplxDbl,
|
|
CCplxConst, creal, cimag);
|
|
|
|
/* declaring the typemaps */
|
|
%typemap_stype(float_complex, CPLXFLT, CCplxFlt);
|
|
%typemap_stype(double_complex, CPLXDBL, CCplxDbl);
|
|
|
|
%apply double_complex { complex };
|
|
|
|
|
|
|
|
#endif //__python_ccomplex_i__
|