summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-07-19 09:50:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-07-19 09:50:08 (GMT)
commit5d45d73b29afd5a9bb5df459ede7055b3e97ba5d (patch)
tree860a17de26aa6a8d1c68ddbfc192c62e79d07ca9
parent6f094ddde17be4284f76f82a83b5d5f2cba10db6 (diff)
parent004fe2d35203d7d11d592e8808c83f8a04dfeb31 (diff)
downloadtcl-5d45d73b29afd5a9bb5df459ede7055b3e97ba5d.zip
tcl-5d45d73b29afd5a9bb5df459ede7055b3e97ba5d.tar.gz
tcl-5d45d73b29afd5a9bb5df459ede7055b3e97ba5d.tar.bz2
Make sure that tclAppInit.c is never built with -DUSE_TCL_STUBS, so we don't need those dirty tricks in it any more.
-rw-r--r--generic/tcl.h2
-rw-r--r--generic/tclDecls.h9
-rw-r--r--unix/Makefile.in10
-rw-r--r--unix/tclAppInit.c15
-rw-r--r--win/tclAppInit.c25
5 files changed, 30 insertions, 31 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index d99e9fa..ca68eaa 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2379,7 +2379,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
#if defined(_WIN32)
TCL_NORETURN void Tcl_ConsolePanic(const char *format, ...);
#else
-# define Tcl_ConsolePanic ((Tcl_PanicProc *)0)
+# define Tcl_ConsolePanic ((Tcl_PanicProc *)NULL)
#endif
#ifdef USE_TCL_STUBS
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index b869c97..28696df 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4069,19 +4069,10 @@ extern const TclStubs *tclStubsPtr;
#undef TclUnusedStubEntry
#if defined(USE_TCL_STUBS)
-# undef Tcl_CreateInterp
# undef Tcl_FindExecutable
-# undef Tcl_GetStringResult
-# undef Tcl_Init
# undef Tcl_SetPanicProc
# undef Tcl_SetExitProc
-# undef Tcl_ObjSetVar2
# undef Tcl_StaticLibrary
-# define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp())
-# define Tcl_GetStringResult(interp) (tclStubsPtr->tcl_GetStringResult(interp))
-# define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp))
-# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \
- (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags))
#endif
#if defined(_WIN32) && defined(UNICODE)
diff --git a/unix/Makefile.in b/unix/Makefile.in
index d0a9d86..28fa446 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -176,7 +176,7 @@ NATIVE_TCLSH = @TCLSH_PROG@
STLIB_LD = @STLIB_LD@
SHLIB_LD = @SHLIB_LD@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@ -DBUILD_tcl
+SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@
TCL_SHLIB_LD_EXTRAS = @TCL_SHLIB_LD_EXTRAS@
@@ -278,12 +278,12 @@ VALGRINDARGS = --tool=memcheck --num-callers=24 \
STUB_CC_SWITCHES = -I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \
${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
- ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} \
- @EXTRA_CC_SWITCHES@
+ ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ \
+ ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS -DMP_NO_STDINT
-CC_SWITCHES = $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS -DMP_NO_STDINT
+CC_SWITCHES = $(STUB_CC_SWITCHES) -DBUILD_tcl
-APP_CC_SWITCHES = $(CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@
+APP_CC_SWITCHES = $(STUB_CC_SWITCHES) @EXTRA_APP_CC_SWITCHES@
LIBS = @TCL_LIBS@
diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c
index 29ca4e4..05d25de 100644
--- a/unix/tclAppInit.c
+++ b/unix/tclAppInit.c
@@ -12,12 +12,15 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef BUILD_tcl
-#undef STATIC_BUILD
#include "tcl.h"
-#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
+#if TCL_MAJOR_VERSION < 9
+# if defined(USE_TCL_STUBS)
+# error "Don't build with USE_TCL_STUBS!"
+# endif
+# if TCL_MINOR_VERSION < 7
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
+# endif
#endif
#ifdef TCL_TEST
@@ -115,7 +118,7 @@ int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
- if ((Tcl_Init)(interp) == TCL_ERROR) {
+ if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
@@ -157,10 +160,10 @@ Tcl_AppInit(
*/
#ifdef DJGPP
- (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
+ Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
Tcl_NewStringObj("~/tclsh.rc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY);
#else
- (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
+ Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL,
Tcl_NewStringObj("~/.tclshrc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY);
#endif
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index eaa4fb3..27eb164 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -15,17 +15,14 @@
*/
#include "tcl.h"
-#define WIN32_LEAN_AND_MEAN
-#define STRICT /* See MSDN Article Q83456 */
-#include <windows.h>
-#undef STRICT
-#undef WIN32_LEAN_AND_MEAN
-#include <locale.h>
-#include <stdlib.h>
-#include <tchar.h>
-#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
+#if TCL_MAJOR_VERSION < 9
+# if defined(USE_TCL_STUBS)
+# error "Don't build with USE_TCL_STUBS!"
+# endif
+# if TCL_MINOR_VERSION < 7
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
+# endif
#endif
#ifdef TCL_TEST
@@ -39,6 +36,14 @@ extern Tcl_LibraryInitProc Dde_Init;
extern Tcl_LibraryInitProc Dde_SafeInit;
#endif
+#define WIN32_LEAN_AND_MEAN
+#define STRICT /* See MSDN Article Q83456 */
+#include <windows.h>
+#undef STRICT
+#undef WIN32_LEAN_AND_MEAN
+#include <locale.h>
+#include <stdlib.h>
+#include <tchar.h>
#if defined(__GNUC__) || defined(TCL_BROKEN_MAINARGS)
int _CRT_glob = 0;
#endif /* __GNUC__ || TCL_BROKEN_MAINARGS */
@@ -163,7 +168,7 @@ int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
- if ((Tcl_Init)(interp) == TCL_ERROR) {
+ if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}