diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:46:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:46:42 (GMT) |
commit | 4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch) | |
tree | d5db4ca8a1fecbd63d9e72730fad2f404367daff /unix/tclLoadDl.c | |
parent | 63994a73e3f641451b26f48f697b6a069863751c (diff) | |
parent | 52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff) | |
download | tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2 |
Merge 8.7
Diffstat (limited to 'unix/tclLoadDl.c')
-rw-r--r-- | unix/tclLoadDl.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index d68df76..4b8fca6 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -83,7 +83,7 @@ TclpDlopen( * relative path. */ - native = Tcl_FSGetNativePath(pathPtr); + native = (const char *)Tcl_FSGetNativePath(pathPtr); /* * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070] */ @@ -131,7 +131,7 @@ TclpDlopen( } return TCL_ERROR; } - newHandle = Tcl_Alloc(sizeof(*newHandle)); + newHandle = (Tcl_LoadHandle)Tcl_Alloc(sizeof(*newHandle)); newHandle->clientData = handle; newHandle->findSymbolProcPtr = &FindSymbol; newHandle->unloadFileProcPtr = &UnloadFile; @@ -188,6 +188,31 @@ FindSymbol( proc = dlsym(handle, native); /* INTL: Native. */ Tcl_DStringFree(&newName); } +#ifdef __cplusplus + if (proc == NULL) { + char buf[32]; + sprintf(buf, "%d", (int)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. */ + } + if (proc == NULL) { + TclDStringAppendLiteral(&newName, "i"); + 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(); @@ -261,6 +286,8 @@ TclGuessPackageName( Tcl_DString *bufPtr) /* Initialized empty dstring. Append package * name to this if possible. */ { + (void)fileName; + (void)bufPtr; return 0; } |