Skip to content

Commit

Permalink
Undo previous commit, it didn't really help.
Browse files Browse the repository at this point in the history
Fix tests for Tcl_UtfNext/Tcl_UtfPrev, which were always expected in UTF-32 mode.
Make Tcl_SetResult() usable with TCL_NO_DEPRECATED too, otherwise it leads to a test crash
Always install header-files before documentation: If documentation copying takes too long it can be aborted.
  • Loading branch information
jan.nijtmans committed Jan 14, 2025
1 parent e7a7b15 commit 74c0e69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions generic/tclDecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -4331,8 +4331,9 @@ extern const TclStubs *tclStubsPtr;
#undef Tcl_SaveResult
#undef Tcl_RestoreResult
#undef Tcl_DiscardResult
#undef Tcl_SetResult
#undef Tcl_MakeSafe
#endif /* TCL_NO_DEPRECATED */
#undef Tcl_SetResult
#define Tcl_SetResult(interp, result, freeProc) \
do { \
const char *__result = result; \
Expand All @@ -4346,7 +4347,6 @@ extern const TclStubs *tclStubsPtr;
} \
} \
} while(0)
#endif /* TCL_NO_DEPRECATED */

#if defined(USE_TCL_STUBS)
# if defined(_WIN32) && defined(_WIN64)
Expand Down
28 changes: 17 additions & 11 deletions generic/tclTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/

#undef STATIC_BUILD
#undef BUILD_tcl
#undef STATIC_BUILD
#ifndef USE_TCL_STUBS
# define USE_TCL_STUBS
#endif
#undef TCL_UTF_MAX
#ifdef TCL_NO_DEPRECATED
# undef TCL_NO_DEPRECATED
# define TCL_UTF_MAX 4
#else
# define TCL_UTF_MAX 3
Expand All @@ -31,6 +32,11 @@
#include "tclOO.h"
#include <math.h>

/* We want to test the UTF-32 versions of the following 3 functions */
#undef Tcl_UtfNext
#undef Tcl_UtfPrev
#define Tcl_UtfNext (tclStubsPtr->tcl_UtfNext)
#define Tcl_UtfPrev (tclStubsPtr->tcl_UtfPrev)
/*
* Required for Testregexp*Cmd
*/
Expand Down Expand Up @@ -143,9 +149,9 @@ typedef struct {
* was called for a result.
*/

#ifndef TCL_NO_DEPRECATED
#if TCL_UTF_MAX < 4
static int freeCount;
#endif /* TCL_NO_DEPRECATED */
#endif /* TCL_UTF_MAX */

/*
* Boolean flag used by the "testsetmainloop" and "testexitmainloop" commands.
Expand Down Expand Up @@ -296,10 +302,10 @@ static Tcl_ObjCmdProc TestregexpObjCmd;
static Tcl_ObjCmdProc TestreturnObjCmd;
static void TestregexpXflags(const char *string,
size_t length, int *cflagsPtr, int *eflagsPtr);
#ifndef TCL_NO_DEPRECATED
#if TCL_UTF_MAX < 4
static Tcl_ObjCmdProc TestsaveresultCmd;
static Tcl_FreeProc TestsaveresultFree;
#endif /* TCL_NO_DEPRECATED */
#endif /* TCL_UTF_MAX */
static Tcl_CmdProc TestsetassocdataCmd;
static Tcl_CmdProc TestsetCmd;
static Tcl_CmdProc Testset2Cmd;
Expand Down Expand Up @@ -689,10 +695,10 @@ Tcltest_Init(
NULL, NULL);
Tcl_CreateObjCommand(interp, "testreturn", TestreturnObjCmd,
NULL, NULL);
#ifndef TCL_NO_DEPRECATED
#if TCL_UTF_MAX < 4
Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd,
NULL, NULL);
#endif /* TCL_NO_DEPRECATED */
#endif
Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd,
Expand Down Expand Up @@ -2167,7 +2173,7 @@ static int UtfExtWrapper(
if (dstCharsVar == NULL ||
(valueObj = Tcl_ObjGetVar2(interp, dstCharsVar, NULL, 0)) == NULL
) {
Tcl_SetResult(interp,
Tcl_SetResult(interp, (char *)
"dstCharsVar must be specified with integer value if "
"TCL_ENCODING_CHAR_LIMIT set in flags.", TCL_STATIC);
return TCL_ERROR;
Expand All @@ -2190,7 +2196,7 @@ static int UtfExtWrapper(
&dstWrote,
dstCharsVar ? &dstChars : NULL);
if (memcmp(bufPtr + bufLen - 4, "\xAB\xCD\xEF\xAB", 4)) {
Tcl_SetResult(interp,
Tcl_SetResult(interp, (char *)
"Tcl_ExternalToUtf wrote past output buffer",
TCL_STATIC);
result = TCL_ERROR;
Expand Down Expand Up @@ -5917,7 +5923,7 @@ Testset2Cmd(
*----------------------------------------------------------------------
*/

#ifndef TCL_NO_DEPRECATED
#if TCL_UTF_MAX < 4
static int
TestsaveresultCmd(
TCL_UNUSED(void *),
Expand Down Expand Up @@ -6035,7 +6041,7 @@ TestsaveresultFree(
{
freeCount++;
}
#endif /* TCL_NO_DEPRECATED */
#endif /* TCL_UTF_MAX */

/*
*----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion unix/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ INSTALL_DOC_TARGETS = install-doc
INSTALL_PACKAGE_TARGETS = install-packages
INSTALL_DEV_TARGETS = install-headers
INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DEV_TARGETS) $(INSTALL_DOC_TARGETS) \
$(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)

install: $(INSTALL_TARGETS)
Expand Down

0 comments on commit 74c0e69

Please sign in to comment.