summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-12-21 12:43:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-12-21 12:43:54 (GMT)
commit63b07461da87c89858482b065e62b2d31d765c40 (patch)
treed4b1ae4c334096eaece7fe4b101b7d451b82d5ef
parent1c3288f038d8b2f9883e3b9f63f37f42e6811969 (diff)
downloadtcl-63b07461da87c89858482b065e62b2d31d765c40.zip
tcl-63b07461da87c89858482b065e62b2d31d765c40.tar.gz
tcl-63b07461da87c89858482b065e62b2d31d765c40.tar.bz2
Fix android compilation (zipfsFilesystem.loadFileProc is a constant, so it cannot be written)
-rw-r--r--generic/zipfs.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/generic/zipfs.c b/generic/zipfs.c
index 6179542..b54d5a2 100644
--- a/generic/zipfs.c
+++ b/generic/zipfs.c
@@ -2807,7 +2807,7 @@ merror0:
stream.opaque = Z_NULL;
stream.avail_in = z->nbytecompr;
if (z->isenc) {
- unsigned int j;
+ unsigned int j;
stream.avail_in -= 12;
cbuf = (unsigned char *)
Tcl_AttemptAlloc(stream.avail_in);
@@ -3734,7 +3734,6 @@ Zip_FSFilesystemPathTypeProc(Tcl_Obj *pathPtr)
return Tcl_NewStringObj("zip", -1);
}
-#ifndef ANDROID
/*
*-------------------------------------------------------------------------
@@ -3762,6 +3761,14 @@ static int
Zip_FSLoadFile(Tcl_Interp *interp, Tcl_Obj *path, Tcl_LoadHandle *loadHandle,
Tcl_FSUnloadFileProc **unloadProcPtr, int flags)
{
+#ifdef ANDROID
+ /*
+ * Force loadFileProc to native implementation since the
+ * package manger already extracted the shared libraries
+ * from the APK at install time.
+ */
+ return tclNativeFilesystem.loadFileProc(interp, path, loadHandle, unloadProcPtr, flags);
+#else
Tcl_FSLoadFileProc2 *loadFileProc;
Tcl_Obj *altPath = NULL;
int ret = -1;
@@ -3813,8 +3820,8 @@ Zip_FSLoadFile(Tcl_Interp *interp, Tcl_Obj *path, Tcl_LoadHandle *loadHandle,
Tcl_DecrRefCount(altPath);
}
return ret;
-}
#endif
+}
/*
@@ -3852,11 +3859,7 @@ const Tcl_Filesystem zipfsFilesystem = {
NULL, /* renameFileProc */
NULL, /* copyDirectoryProc */
NULL, /* lstatProc */
-#ifdef ANDROID
- NULL, /* loadFileProc */
-#else
(Tcl_FSLoadFileProc *) Zip_FSLoadFile,
-#endif
NULL, /* getCwdProc */
Zip_FSChdirProc,
};
@@ -3922,14 +3925,6 @@ Zipfs_doInit(Tcl_Interp *interp, int safe)
Tcl_ConditionWait(&ZipFSCond, &ZipFSMutex, &t);
Tcl_MutexUnlock(&ZipFSMutex);
#endif
-#ifdef ANDROID
- /*
- * Force loadFileProc to native implementation since the
- * package manger already extracted the shared libraries
- * from the APK at install time.
- */
- zipfsFilesystem.loadFileProc = tclNativeFilesystem.loadFileProc;
-#endif
Tcl_FSRegister(NULL, &zipfsFilesystem);
Tcl_InitHashTable(&ZipFS.fileHash, TCL_STRING_KEYS);
Tcl_InitHashTable(&ZipFS.zipHash, TCL_STRING_KEYS);