summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-04-25 14:59:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-04-25 14:59:55 (GMT)
commit7fc1793e376c779b947e5698bb75726478706d09 (patch)
treeaf11aa5233e36439b8b6711af51d1ae1555246d9
parentaa91667499a3100f53b03c6619736a85611dd9a2 (diff)
parentf5af55e3585dc3b89fabce063491e1831d75d975 (diff)
downloadtcl-7fc1793e376c779b947e5698bb75726478706d09.zip
tcl-7fc1793e376c779b947e5698bb75726478706d09.tar.gz
tcl-7fc1793e376c779b947e5698bb75726478706d09.tar.bz2
Fix for [ef23a85ac6]: Tcl_PanicProc - Tcl9 & NaviServer.
-rw-r--r--generic/tcl.decls8
-rw-r--r--generic/tclDecls.h9
-rw-r--r--generic/tclEvent.c6
-rw-r--r--generic/tclPanic.c36
-rw-r--r--win/tclWinError.c8
-rw-r--r--win/tclWinFile.c14
6 files changed, 32 insertions, 49 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 2ffa808..dc67078 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -815,7 +815,7 @@ declare 229 {
void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
}
declare 230 {nostub {Don't use this function in a stub-enabled extension}} {
- const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
+ const char *Tcl_SetPanicProc(Tcl_PanicProc *panicProc)
}
declare 231 {
Tcl_Size Tcl_SetRecursionLimit(Tcl_Interp *interp, Tcl_Size depth)
@@ -1872,7 +1872,7 @@ declare 518 {
# TIP#121 (exit handler) dkf for Joe Mistachkin
declare 519 {nostub {Don't use this function in a stub-enabled extension}} {
- Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
+ Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc)
}
# TIP#143 (resource limits) dkf
@@ -2579,10 +2579,10 @@ export {
Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc)
}
export {
- const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
+ const char *Tcl_SetPanicProc(Tcl_PanicProc *panicProc)
}
export {
- Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
+ Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc)
}
export {
const char *Tcl_FindExecutable(const char *argv0)
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 357bb7c..75483a7 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -721,8 +721,7 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...);
/* 229 */
EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr);
/* 230 */
-EXTERN const char * Tcl_SetPanicProc(
- TCL_NORETURN1 Tcl_PanicProc *panicProc);
+EXTERN const char * Tcl_SetPanicProc(Tcl_PanicProc *panicProc);
/* 231 */
EXTERN Tcl_Size Tcl_SetRecursionLimit(Tcl_Interp *interp,
Tcl_Size depth);
@@ -1566,7 +1565,7 @@ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp,
EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp,
Tcl_Obj *fileName, const char *encodingName);
/* 519 */
-EXTERN Tcl_ExitProc * Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc);
+EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc);
/* 520 */
EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type,
Tcl_LimitHandlerProc *handlerProc,
@@ -2290,7 +2289,7 @@ typedef struct TclStubs {
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
- TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_SetPanicProc) (Tcl_PanicProc *panicProc); /* 230 */
Tcl_Size (*tcl_SetRecursionLimit) (Tcl_Interp *interp, Tcl_Size depth); /* 231 */
void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
int (*tcl_SetServiceMode) (int mode); /* 233 */
@@ -2579,7 +2578,7 @@ typedef struct TclStubs {
Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */
void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */
int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */
- TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */
void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, void *clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */
void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, void *clientData); /* 521 */
int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 1a2f8ca..e7c09ca 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -105,7 +105,7 @@ static const char ENCODING_ERROR[] = "\n\t(encoding error in stderr)";
* non-NULL value.
*/
-static TCL_NORETURN1 Tcl_ExitProc *appExitPtr = NULL;
+static Tcl_ExitProc *appExitPtr = NULL;
typedef struct ThreadSpecificData {
ExitHandler *firstExitPtr; /* First in list of all exit handlers for this
@@ -888,7 +888,7 @@ Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *
Tcl_SetExitProc(
- TCL_NORETURN1 Tcl_ExitProc *proc) /* New exit handler for app or NULL */
+ Tcl_ExitProc *proc) /* New exit handler for app or NULL */
{
Tcl_ExitProc *prevExitProc;
@@ -969,7 +969,7 @@ Tcl_Exit(
int status) /* Exit status for application; typically 0
* for normal return, 1 for error return. */
{
- TCL_NORETURN1 Tcl_ExitProc *currentAppExitPtr;
+ Tcl_ExitProc *currentAppExitPtr;
Tcl_MutexLock(&exitMutex);
currentAppExitPtr = appExitPtr;
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 1f5ef27..e379d95 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -15,7 +15,7 @@
#include "tclInt.h"
#if defined(_WIN32) || defined(__CYGWIN__)
- MODULE_SCOPE TCL_NORETURN void tclWinDebugPanic(const char *format, ...);
+ MODULE_SCOPE void tclWinDebugPanic(const char *format, ...);
#endif
/*
@@ -24,9 +24,9 @@
*/
#if defined(__CYGWIN__) || (defined(_WIN32) && (defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8))
-static TCL_NORETURN1 Tcl_PanicProc *panicProc = tclWinDebugPanic;
+static Tcl_PanicProc *panicProc = tclWinDebugPanic;
#else
-static TCL_NORETURN1 Tcl_PanicProc *panicProc = NULL;
+static Tcl_PanicProc *panicProc = NULL;
#endif
/*
@@ -48,7 +48,7 @@ static TCL_NORETURN1 Tcl_PanicProc *panicProc = NULL;
#undef Tcl_SetPanicProc
const char *
Tcl_SetPanicProc(
- TCL_NORETURN1 Tcl_PanicProc *proc)
+ Tcl_PanicProc *proc)
{
#if defined(_WIN32)
/* tclWinDebugPanic only installs if there is no panicProc yet. */
@@ -78,7 +78,7 @@ Tcl_SetPanicProc(
*----------------------------------------------------------------------
*/
-void
+TCL_NORETURN void
Tcl_PanicVA(
const char *format, /* Format string, suitable for passing to
* fprintf. */
@@ -108,23 +108,23 @@ Tcl_PanicVA(
arg8);
fprintf(stderr, "\n");
fflush(stderr);
+ }
#if defined(_WIN32) || defined(__CYGWIN__)
-# if defined(__GNUC__)
- __builtin_trap();
-# elif defined(_WIN64)
- __debugbreak();
-# elif defined(_MSC_VER) && defined (_M_IX86)
- _asm {int 3}
-# else
- DebugBreak();
-# endif
+#if defined(__GNUC__)
+ __builtin_trap();
+#elif defined(_WIN64)
+ __debugbreak();
+#elif defined(_MSC_VER) && defined (_M_IX86)
+ _asm {int 3}
+#else
+ DebugBreak();
+#endif
#endif
#if defined(_WIN32)
- ExitProcess(1);
+ ExitProcess(1);
#else
- abort();
+ abort();
#endif
- }
}
/*
@@ -149,7 +149,7 @@ Tcl_PanicVA(
*/
/* coverity[+kill] */
-void
+TCL_NORETURN void
Tcl_Panic(
const char *format,
...)
diff --git a/win/tclWinError.c b/win/tclWinError.c
index 7e5898b..4e8ae7e 100644
--- a/win/tclWinError.c
+++ b/win/tclWinError.c
@@ -381,7 +381,7 @@ Tcl_WinConvertError(
*----------------------------------------------------------------------
*/
-TCL_NORETURN void
+void
tclWinDebugPanic(
const char *format, ...)
{
@@ -413,12 +413,6 @@ tclWinDebugPanic(
fprintf(stderr, "\n");
fflush(stderr);
}
-# if defined(__GNUC__)
- __builtin_trap();
-# else
- DebugBreak();
-# endif
- abort();
}
#endif
/*
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index b27487f..a808562 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -177,7 +177,7 @@ static int WinLink(const WCHAR *LinkSource,
const WCHAR *LinkTarget, int linkAction);
static int WinSymLinkDirectory(const WCHAR *LinkDirectory,
const WCHAR *LinkTarget);
-MODULE_SCOPE TCL_NORETURN void tclWinDebugPanic(const char *format, ...);
+MODULE_SCOPE void tclWinDebugPanic(const char *format, ...);
/*
*--------------------------------------------------------------------
@@ -808,7 +808,7 @@ NativeWriteReparse(
*----------------------------------------------------------------------
*/
-TCL_NORETURN void
+void
tclWinDebugPanic(
const char *format, ...)
{
@@ -838,16 +838,6 @@ tclWinDebugPanic(
MessageBoxW(NULL, msgString, L"Fatal Error",
MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
}
-#if defined(__GNUC__)
- __builtin_trap();
-#elif defined(_WIN64)
- __debugbreak();
-#elif defined(_MSC_VER) && defined (_M_IX86)
- _asm {int 3}
-#else
- DebugBreak();
-#endif
- abort();
}
/*