Skip to content

Commit

Permalink
Rebase to 9.0. Re-generate "configure"
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Oct 9, 2024
2 parents ee1bf9d + 4c08830 commit 8c8520c
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 251 deletions.
12 changes: 1 addition & 11 deletions generic/tclBasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,19 +1339,9 @@ Tcl_CreateInterp(void)
Tcl_Panic("%s", Tcl_GetStringResult(interp));
}

/*
* Only build in zlib support if we've successfully detected a library to
* compile and link against.
*/

#ifdef HAVE_ZLIB
if (TclZlibInit(interp) != TCL_OK) {
if (TclZlibInit(interp) != TCL_OK || TclZipfs_Init(interp) != TCL_OK) {
Tcl_Panic("%s", Tcl_GetStringResult(interp));
}
if (TclZipfs_Init(interp) != TCL_OK) {
Tcl_Panic("%s", Tcl_GetStringResult(interp));
}
#endif

TOP_CB(iPtr) = NULL;
return interp;
Expand Down
8 changes: 4 additions & 4 deletions generic/tclEvent.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

#include "tclInt.h"
#include "tclUuid.h"
#if defined(HAVE_ZLIB) && defined(TCL_WITH_INTERNAL_ZLIB)
#ifdef TCL_WITH_INTERNAL_ZLIB
#include "zlib.h"
#endif /* HAVE_ZLIB */
#endif /* TCL_WITH_INTERNAL_ZLIB */

/*
* The data structure below is used to report background errors. One such
Expand Down Expand Up @@ -1105,7 +1105,7 @@ static const struct {
#ifndef TCL_WITH_EXTERNAL_TOMMATH
".tommath-0103"
#endif
#if defined(HAVE_ZLIB) && defined(TCL_WITH_INTERNAL_ZLIB)
#ifdef TCL_WITH_INTERNAL_ZLIB
".zlib-"
#if ZLIB_VER_MAJOR < 10
"0"
Expand All @@ -1115,7 +1115,7 @@ static const struct {
"0"
#endif
STRINGIFY(ZLIB_VER_MINOR)
#endif
#endif // TCL_WITH_INTERNAL_ZLIB
}};

const char *
Expand Down
86 changes: 0 additions & 86 deletions generic/tclZipfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
} \
} while (0)

#ifdef HAVE_ZLIB
#include "zlib.h"
#include "crypt.h"
#include "zutil.h"
Expand Down Expand Up @@ -6204,8 +6203,6 @@ ZipFSLoadFile(
return ret;
#endif /* ANDROID */
}

#endif /* HAVE_ZLIB */

/*
*-------------------------------------------------------------------------
Expand All @@ -6228,7 +6225,6 @@ int
TclZipfs_Init(
Tcl_Interp *interp) /* Current interpreter. */
{
#ifdef HAVE_ZLIB
static const EnsembleImplMap initMap[] = {
{"mkimg", ZipFSMkImgObjCmd, NULL, NULL, NULL, 1},
{"mkzip", ZipFSMkZipObjCmd, NULL, NULL, NULL, 1},
Expand Down Expand Up @@ -6300,15 +6296,8 @@ TclZipfs_Init(
ZipFSTclLibraryObjCmd, NULL, NULL);
}
return TCL_OK;
#else /* !HAVE_ZLIB */
ZIPFS_ERROR(interp, "no zlib available");
ZIPFS_ERROR_CODE(interp, "NO_ZLIB");
return TCL_ERROR;
#endif /* HAVE_ZLIB */
}

#ifdef HAVE_ZLIB

#if !defined(STATIC_BUILD)
static int
ZipfsAppHookFindTclInit(
Expand Down Expand Up @@ -6532,81 +6521,6 @@ TclZipfs_AppHook(
return result;
}

#else /* !HAVE_ZLIB */

/*
*-------------------------------------------------------------------------
*
* TclZipfs_Mount, TclZipfs_MountBuffer, TclZipfs_Unmount --
*
* Dummy version when no ZLIB support available.
*
*-------------------------------------------------------------------------
*/

int
TclZipfs_Mount(
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(const char *), /* Path to ZIP file to mount. */
TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(const char *)) /* Password for opening the ZIP, or NULL if
* the ZIP is unprotected. */
{
ZIPFS_ERROR(interp, "no zlib available");
ZIPFS_ERROR_CODE(interp, "NO_ZLIB");
return TCL_ERROR;
}

int
TclZipfs_MountBuffer(
Tcl_Interp *interp, /* Current interpreter. NULLable. */
TCL_UNUSED(const void *),
TCL_UNUSED(size_t),
TCL_UNUSED(const char *), /* Mount point path. */
TCL_UNUSED(int))
{
ZIPFS_ERROR(interp, "no zlib available");
ZIPFS_ERROR_CODE(interp, "NO_ZLIB");
return TCL_ERROR;
}

int
TclZipfs_Unmount(
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(const char *)) /* Mount point path. */
{
ZIPFS_ERROR(interp, "no zlib available");
ZIPFS_ERROR_CODE(interp, "NO_ZLIB");
return TCL_ERROR;
}

const char *
TclZipfs_AppHook(
TCL_UNUSED(int *), /*argcPtr*/
#ifdef _WIN32
TCL_UNUSED(WCHAR ***)) /* argvPtr */
#else /* !_WIN32 */
TCL_UNUSED(char ***)) /* Pointer to argv */
#endif /* _WIN32 */
{
return NULL;
}

Tcl_Obj *
TclZipfs_TclLibrary(void)
{
return NULL;
}

int
TclIsZipfsPath(
TCL_UNUSED(const char *)) /* path */
{
return 0;
}

#endif /* !HAVE_ZLIB */

/*
* Local Variables:
* mode: c
Expand Down
138 changes: 0 additions & 138 deletions generic/tclZlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include "tclInt.h"
#ifdef HAVE_ZLIB
#include "zlib.h"
#include "tclIO.h"

Expand Down Expand Up @@ -4041,143 +4040,6 @@ TclZlibInit(
return Tcl_PkgProvideEx(interp, "tcl::zlib", TCL_ZLIB_VERSION, NULL);
}

/*
*----------------------------------------------------------------------
* Stubs used when a suitable zlib installation was not found during
* configure.
*----------------------------------------------------------------------
*/

#else /* !HAVE_ZLIB */
int
Tcl_ZlibStreamInit(
Tcl_Interp *interp,
int mode,
int format,
int level,
Tcl_Obj *dictObj,
Tcl_ZlibStream *zshandle)
{
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"unimplemented", TCL_AUTO_LENGTH));
Tcl_SetErrorCode(interp, "TCL", "UNIMPLEMENTED", (char *)NULL);
}
return TCL_ERROR;
}

int
Tcl_ZlibStreamClose(
Tcl_ZlibStream zshandle)
{
return TCL_OK;
}

int
Tcl_ZlibStreamReset(
Tcl_ZlibStream zshandle)
{
return TCL_OK;
}

Tcl_Obj *
Tcl_ZlibStreamGetCommandName(
Tcl_ZlibStream zshandle)
{
return NULL;
}

int
Tcl_ZlibStreamEof(
Tcl_ZlibStream zshandle)
{
return 1;
}

int
Tcl_ZlibStreamChecksum(
Tcl_ZlibStream zshandle)
{
return 0;
}

int
Tcl_ZlibStreamPut(
Tcl_ZlibStream zshandle,
Tcl_Obj *data,
int flush)
{
return TCL_OK;
}

int
Tcl_ZlibStreamGet(
Tcl_ZlibStream zshandle,
Tcl_Obj *data,
size_t count)
{
return TCL_OK;
}

int
Tcl_ZlibDeflate(
Tcl_Interp *interp,
int format,
Tcl_Obj *data,
int level,
Tcl_Obj *gzipHeaderDictObj)
{
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"unimplemented", TCL_AUTO_LENGTH));
Tcl_SetErrorCode(interp, "TCL", "UNIMPLEMENTED", (char *)NULL);
}
return TCL_ERROR;
}

int
Tcl_ZlibInflate(
Tcl_Interp *interp,
int format,
Tcl_Obj *data,
size_t bufferSize,
Tcl_Obj *gzipHeaderDictObj)
{
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"unimplemented", TCL_AUTO_LENGTH));
Tcl_SetErrorCode(interp, "TCL", "UNIMPLEMENTED", (char *)NULL);
}
return TCL_ERROR;
}

unsigned int
Tcl_ZlibCRC32(
TCL_UNUSED(unsigned int),
TCL_UNUSED(const unsigned char *),
TCL_UNUSED(size_t))
{
return 0;
}

unsigned int
Tcl_ZlibAdler32(
TCL_UNUSED(unsigned int),
TCL_UNUSED(const unsigned char *),
TCL_UNUSED(size_t))
{
return 0;
}

void
Tcl_ZlibStreamSetCompressionDictionary(
Tcl_ZlibStream zshandle,
Tcl_Obj *compressionDictionaryObj)
{
/* Do nothing. */
}
#endif /* HAVE_ZLIB */

/*
* Local Variables:
* mode: c
Expand Down
3 changes: 0 additions & 3 deletions unix/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5210,9 +5210,6 @@ printf "%s\n" "#define TCL_WITH_INTERNAL_ZLIB 1" >>confdefs.h

fi

printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h


#------------------------------------------------------------------------
# Add stuff for libtommath

Expand Down
1 change: 0 additions & 1 deletion unix/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ AS_IF([test $zlib_ok = no], [
AC_SUBST(ZLIB_INCLUDE,[-I\${ZLIB_DIR}])
AC_DEFINE(TCL_WITH_INTERNAL_ZLIB, 1, [Tcl with internal zlib])
])
AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])

#------------------------------------------------------------------------
# Add stuff for libtommath
Expand Down
3 changes: 0 additions & 3 deletions unix/tclConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@
/* Is weak import available? */
#undef HAVE_WEAK_IMPORT

/* Is there an installed zlib? */
#undef HAVE_ZLIB

/* Is this a Mac I see before me? */
#undef MAC_OSX_TCL

Expand Down
3 changes: 0 additions & 3 deletions win/configure
Original file line number Diff line number Diff line change
Expand Up @@ -5027,9 +5027,6 @@ printf "%s\n" "#define TCL_WITH_INTERNAL_ZLIB 1" >>confdefs.h
;;
esac
fi

printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h

TCL_ZLIB_LIB_NAME=$zlib_lib_name

TCL_TOMMATH_LIB_NAME=$tommath_lib_name
Expand Down
1 change: 0 additions & 1 deletion win/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ AS_IF([test "$tcl_ok" = "yes"], [
AC_SUBST(ZLIB_OBJS,[\${ZLIB_OBJS}])
AC_SUBST(TOMMATH_OBJS,[\${TOMMATH_OBJS}])
])
AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])
AC_SUBST(TCL_ZLIB_LIB_NAME, $zlib_lib_name)
AC_SUBST(TCL_TOMMATH_LIB_NAME, $tommath_lib_name)
AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[
Expand Down
2 changes: 1 addition & 1 deletion win/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ LIBTCLVFS = $(OUT_DIR)\$(LIBTCLVFSSUBDIR)
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
PRJ_INCLUDES = -I"$(TOMMATHDIR)"
PRJ_DEFINES = /DMP_PREC=4 /Dinline=__inline /DHAVE_ZLIB=1 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMP_FIXED_CUTOFFS
PRJ_DEFINES = /DMP_PREC=4 /Dinline=__inline /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMP_FIXED_CUTOFFS

!if $(STATIC_BUILD)
PRJ_DEFINES = $(PRJ_DEFINES) /DTCL_WITH_INTERNAL_ZLIB
Expand Down

0 comments on commit 8c8520c

Please sign in to comment.