diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-18 20:20:21 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-19 09:09:29 +0100 |
commit | ed333b6b9720e0569cd3c7ccee8f1fc1b60da9f8 (patch) | |
tree | 8a0e78d0ce7353aab44e8a5452833d535db4991a /Lib/guile/std_string.i | |
parent | 4a29229bab06cd5ab21715c93c03e9280feae065 (diff) | |
download | swig-ed333b6b9720e0569cd3c7ccee8f1fc1b60da9f8.tar.gz |
std::string throws typemaps
Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that
thrown string exception messages can be seen.
Test all language for std::string throws typemaps
Diffstat (limited to 'Lib/guile/std_string.i')
-rw-r--r-- | Lib/guile/std_string.i | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/guile/std_string.i b/Lib/guile/std_string.i index fbd27547f..c49bfcb07 100644 --- a/Lib/guile/std_string.i +++ b/Lib/guile/std_string.i @@ -83,4 +83,13 @@ namespace std { $result = SWIG_str02scm($1.c_str()); } + %typemap(throws) string { + scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); + } + + %typemap(throws) const string & { + scm_throw(scm_from_locale_symbol((char *) "swig-exception"), + scm_list_n(SWIG_str02scm($1.c_str()), SCM_UNDEFINED)); + } } |