summaryrefslogtreecommitdiffstats
path: root/generic/tclZipfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclZipfs.c')
-rw-r--r--generic/tclZipfs.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index f052c2e..4c668b0 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -3113,7 +3113,7 @@ TclZipfs_TclLibrary(void)
{
Tcl_Obj *vfsInitScript;
int found;
-#if defined(_WIN32) && !defined(STATIC_BUILD)
+#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(STATIC_BUILD)
HMODULE hModule;
WCHAR wName[MAX_PATH + LIBRARY_SIZE];
char dllName[(MAX_PATH + LIBRARY_SIZE) * 3];
@@ -3148,22 +3148,20 @@ TclZipfs_TclLibrary(void)
*/
#if !defined(STATIC_BUILD)
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(__CYGWIN__)
hModule = TclWinGetTclInstance();
GetModuleFileNameW(hModule, wName, MAX_PATH);
+#ifdef __CYGWIN__
+ cygwin_conv_path(3, wName, dllName, sizeof(dllName));
+#else
WideCharToMultiByte(CP_UTF8, 0, wName, -1, dllName, sizeof(dllName), NULL, NULL);
+#endif
if (ZipfsAppHookFindTclInit(dllName) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
#else
- if (ZipfsAppHookFindTclInit(
-#ifdef __CYGWIN__
- CFG_RUNTIME_BINDIR
-#else
- CFG_RUNTIME_LIBDIR
-#endif
- "/" CFG_RUNTIME_DLLFILE) == TCL_OK) {
+ if (ZipfsAppHookFindTclInit(CFG_RUNTIME_LIBDIR "/" CFG_RUNTIME_DLLFILE) == TCL_OK) {
return Tcl_NewStringObj(zipfs_literal_tcl_library, -1);
}
#endif /* _WIN32 */