diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-04 20:51:06 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-04 20:51:06 (GMT) |
commit | 650605595407701981f6662028e353accea5d38c (patch) | |
tree | 6613991422b7428bb02afcf3167649423b6acbd9 /unix/tclLoadDl.c | |
parent | 8c60b1157a27a535111861c5a83b64d502ec1948 (diff) | |
download | tcl-650605595407701981f6662028e353accea5d38c.zip tcl-650605595407701981f6662028e353accea5d38c.tar.gz tcl-650605595407701981f6662028e353accea5d38c.tar.bz2 |
(experiment) Allow C++ symbols to be found in loaded extensions
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r-- | unix/tclLoadDl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index 412c73f..73a44f2 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -188,6 +188,23 @@ FindSymbol( proc = dlsym(handle, native); /* INTL: Native. */ Tcl_DStringFree(&newName); } +#ifdef __cplusplus + if (proc == NULL) { + char buf[32]; + sprintf(buf, "%d", Tcl_DStringLength(&ds)); + Tcl_DStringInit(&newName); + TclDStringAppendLiteral(&newName, "__Z"); + Tcl_DStringAppend(&newName, buf, -1); + Tcl_DStringAppend(&newName, Tcl_DStringValue(&ds), -1); + TclDStringAppendLiteral(&newName, "P10Tcl_Interp"); + native = Tcl_DStringValue(&newName); + proc = dlsym(handle, native + 1); /* INTL: Native. */ + if (proc == NULL) { + proc = dlsym(handle, native); /* INTL: Native. */ + } + Tcl_DStringFree(&newName); + } +#endif Tcl_DStringFree(&ds); if (proc == NULL) { const char *errorStr = dlerror(); |