cplusplus.i 755 B

12345678910111213141516171819202122
  1. /* -----------------------------------------------------------------------------
  2. * cplusplus.i
  3. *
  4. * SWIG typemaps for C++
  5. * ----------------------------------------------------------------------------- */
  6. %typemap(guile,out) string, std::string {
  7. $result = SWIG_str02scm(const_cast<char*>($1.c_str()));
  8. }
  9. %typemap(guile,in) string, std::string {
  10. $1 = SWIG_scm2str($input);
  11. }
  12. %typemap(guile,out) complex, complex<double>, std::complex<double> {
  13. $result = scm_make_rectangular( scm_from_double ($1.real ()),
  14. scm_from_double ($1.imag ()) );
  15. }
  16. %typemap(guile,in) complex, complex<double>, std::complex<double> {
  17. $1 = std::complex<double>( scm_to_double (scm_real_part ($input)),
  18. scm_to_double (scm_imag_part ($input)) );
  19. }