From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- tiger-compiler/tcsh/src/helper.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tiger-compiler/tcsh/src/helper.hh (limited to 'tiger-compiler/tcsh/src/helper.hh') diff --git a/tiger-compiler/tcsh/src/helper.hh b/tiger-compiler/tcsh/src/helper.hh new file mode 100644 index 0000000..cdbf760 --- /dev/null +++ b/tiger-compiler/tcsh/src/helper.hh @@ -0,0 +1,16 @@ +#ifndef SWIG_HELPER_H +#define SWIG_HELPER_H + +#define STCONVERT(TYPE, TYPENAME) \ +void operator()(const TYPE & e) override \ +{ \ + result = SWIG_NewPointerObj(SWIG_as_voidptr(&e), SWIGTYPE_ ## TYPENAME, 0); \ +} + +#define IFTYPECONVERT(TYPE, TYPENAME) \ +if (const TYPE* d = dynamic_cast(&e); d != nullptr) \ +{ \ + result = SWIG_NewPointerObj(SWIG_as_voidptr(&e), SWIGTYPE_ ## TYPENAME, 0); \ +} + +#endif /* ! SWIG_HELPER_H */ -- cgit v1.2.3