diff options
Diffstat (limited to 'generic/tclZipfs.c')
| -rw-r--r-- | generic/tclZipfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index e43c52e..a5b1413 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -32,6 +32,10 @@ #define TBLS 1 #endif +#if !defined(NO_DLFCN_H) +#include <dlfcn.h> +#endif + #ifdef HAVE_ZLIB #include "zlib.h" #include "crypt.h" @@ -3907,6 +3911,12 @@ TclZipfs_TclLibrary(void) if (ZipfsAppHookFindTclInit(dllName) == TCL_OK) { return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); } +#elif !defined(NO_DLFCN_H) + Dl_info dlinfo; + if (dladdr(TclZipfs_TclLibrary, &dlinfo) && (dlinfo.dli_fname != NULL) + && (ZipfsAppHookFindTclInit(dlinfo.dli_fname) == TCL_OK)) { + return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); + } #else if (ZipfsAppHookFindTclInit(CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_DLLFILE) == TCL_OK) { return Tcl_NewStringObj(zipfs_literal_tcl_library, -1); |
