aboutsummaryrefslogtreecommitdiff
path: root/Lib/javascript/jsc/ccomplex.i
diff options
context:
space:
mode:
authorOliver Buchtala <oliver.buchtala@googlemail.com>2012-09-08 00:56:48 +0000
committerOliver Buchtala <oliver.buchtala@googlemail.com>2012-09-08 00:56:48 +0000
commit050219d998c0a518b54366c6c543fa926e601e5b (patch)
treea199f8711e72e8120ce62fbb02a30c07c87128b5 /Lib/javascript/jsc/ccomplex.i
parent360ef44e09e9072702215c46306731ccbbbc1d03 (diff)
downloadswig-050219d998c0a518b54366c6c543fa926e601e5b.tar.gz
Merge branch 'devel' of https://github.com/Neha03/gsoc2012-javascript into devel
Conflicts: .project COPYRIGHT Doc/Manual/style.css Examples/Makefile.in Examples/test-suite/common.mk Lib/typemaps/strings.swg Makefile.in Source/DOH/fio.c Source/Makefile.am Source/Modules/emit.cxx Source/Modules/javascript.cxx configure.in git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/javascript/jsc/ccomplex.i')
-rw-r--r--Lib/javascript/jsc/ccomplex.i26
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/javascript/jsc/ccomplex.i b/Lib/javascript/jsc/ccomplex.i
new file mode 100644
index 000000000..8eda920bb
--- /dev/null
+++ b/Lib/javascript/jsc/ccomplex.i
@@ -0,0 +1,26 @@
+/* -----------------------------------------------------------------------------
+ * ccomplex.i
+ *
+ * C complex typemaps
+ * ISO C99: 7.3 Complex arithmetic <complex.h>
+ * ----------------------------------------------------------------------------- */
+
+
+%include <javscriptcomplex.swg>
+
+%{
+#include <complex.h>
+%}
+
+
+/* C complex constructor */
+#define CCplxConst(r, i) ((r) + I*(i))
+
+%swig_cplxflt_convn(float complex, CCplxConst, creal, cimag);
+%swig_cplxdbl_convn(double complex, CCplxConst, creal, cimag);
+%swig_cplxdbl_convn(complex, CCplxConst, creal, cimag);
+
+/* declaring the typemaps */
+%typemaps_primitive(SWIG_TYPECHECK_CPLXFLT, float complex);
+%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, double complex);
+%typemaps_primitive(SWIG_TYPECHECK_CPLXDBL, complex);