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
This commit is contained in:
parent
50f4c96409
commit
86984eb3d9
1 changed files with 7 additions and 2 deletions
|
|
@ -21,12 +21,17 @@
|
||||||
|
|
||||||
#ifdef SWIGTCL8
|
#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
|
#else
|
||||||
#ifdef SWIGTCL
|
#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
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue