diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-09-29 09:43:36 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-09-29 09:43:36 +0000 |
commit | 86984eb3d967f9d60be689b833dee113f0ae3e18 (patch) | |
tree | b18749d7207aba7dab8bfbdb7eb6429e4717939d /Lib/exception.i | |
parent | 50f4c96409580c7be67e763d266b2d78c0060277 (diff) | |
download | swig-86984eb3d967f9d60be689b833dee113f0ae3e18.tar.gz |
fix error in const char* to char* invalid cast
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7546 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/exception.i')
-rw-r--r-- | Lib/exception.i | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/exception.i b/Lib/exception.i index 5770e64d1..e106bd0c7 100644 --- a/Lib/exception.i +++ b/Lib/exception.i @@ -21,12 +21,17 @@ #ifdef SWIGTCL8 %{ -#define SWIG_exception(a,b) { Tcl_SetResult(interp,b,TCL_VOLATILE); SWIG_fail; } +/* We cast from 'const char*' to 'char*' since TCL_VOLATILE ensure + that an internal copy of the strng will be stored. + + NOTE: Later use const_cast<char*> via SWIG_const_cast or so. +*/ +#define SWIG_exception(a,b) { Tcl_SetResult(interp,(char *)b,TCL_VOLATILE); SWIG_fail; } %} #else #ifdef SWIGTCL %{ -#define SWIG_exception(a,b) { Tcl_SetResult(interp,b,TCL_VOLATILE); return TCL_ERROR; } +#define SWIG_exception(a,b) { Tcl_SetResult(interp,(char *)b,TCL_VOLATILE); return TCL_ERROR; } %} #endif #endif |