From ec55073555d4635a032d4c661a00a7dfe39d5629 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 29 Apr 2024 10:06:09 +0000 Subject: TCL_NORETURN1 is empty for extensions, just not for Tcl and Tk builds. Why? Backport changing this from 8.7/9.0 --- generic/tcl.decls | 4 ++-- generic/tcl.h | 7 +------ generic/tclDecls.h | 9 ++++----- generic/tclEvent.c | 6 +++--- generic/tclPanic.c | 4 ++-- win/tclWinError.c | 3 --- win/tclWinFile.c | 3 +-- 7 files changed, 13 insertions(+), 23 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index b99ef14..cb47c75 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -814,7 +814,7 @@ declare 229 { void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr) } declare 230 { - void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc) + void Tcl_SetPanicProc(Tcl_PanicProc *panicProc) } declare 231 { int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth) @@ -1872,7 +1872,7 @@ declare 518 { # TIP#121 (exit handler) dkf for Joe Mistachkin declare 519 { - Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc) + Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc) } # TIP#143 (resource limits) dkf diff --git a/generic/tcl.h b/generic/tcl.h index 6b32a63..975244f 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -148,11 +148,6 @@ extern "C" { # define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b))) # endif # define TCL_NORETURN __attribute__ ((noreturn)) -# if defined(BUILD_tcl) || defined(BUILD_tk) -# define TCL_NORETURN1 __attribute__ ((noreturn)) -# else -# define TCL_NORETURN1 /* nothing */ -# endif #else # define TCL_FORMAT_PRINTF(a,b) # if defined(_MSC_VER) && (_MSC_VER >= 1310) @@ -160,8 +155,8 @@ extern "C" { # else # define TCL_NORETURN /* nothing */ # endif -# define TCL_NORETURN1 /* nothing */ #endif +#define TCL_NORETURN1 /* nothing */ /* * Allow a part of Tcl's API to be explicitly marked as deprecated. diff --git a/generic/tclDecls.h b/generic/tclDecls.h index ca2c69f..27b4edc 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -685,8 +685,7 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...); /* 229 */ EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr); /* 230 */ -EXTERN void Tcl_SetPanicProc( - TCL_NORETURN1 Tcl_PanicProc *panicProc); +EXTERN void Tcl_SetPanicProc(Tcl_PanicProc *panicProc); /* 231 */ EXTERN int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth); /* 232 */ @@ -1499,7 +1498,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, @@ -2141,7 +2140,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 */ - void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */ + void (*tcl_SetPanicProc) (Tcl_PanicProc *panicProc); /* 230 */ int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */ void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */ int (*tcl_SetServiceMode) (int mode); /* 233 */ @@ -2430,7 +2429,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_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */ + Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */ void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */ void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */ int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */ diff --git a/generic/tclEvent.c b/generic/tclEvent.c index de19ff8..c2e71ec 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -89,7 +89,7 @@ static int subsystemsInitialized = 0; * 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 @@ -857,7 +857,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; @@ -938,7 +938,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 c4c97ef..56c8fbc 100644 --- a/generic/tclPanic.c +++ b/generic/tclPanic.c @@ -24,9 +24,9 @@ */ #if defined(__CYGWIN__) -static TCL_NORETURN Tcl_PanicProc *panicProc = tclWinDebugPanic; +static Tcl_PanicProc *panicProc = tclWinDebugPanic; #else -static TCL_NORETURN1 Tcl_PanicProc *panicProc = NULL; +static Tcl_PanicProc *panicProc = NULL; #endif /* diff --git a/win/tclWinError.c b/win/tclWinError.c index 6d7e3e1..690859f 100644 --- a/win/tclWinError.c +++ b/win/tclWinError.c @@ -382,9 +382,6 @@ TclWinConvertError( */ MODULE_SCOPE TCL_NORETURN void -tclWinDebugPanic(const char *format, ...); - -TCL_NORETURN void tclWinDebugPanic( const char *format, ...) { diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 9f4e857..d0ff73e 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -177,7 +177,6 @@ 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, ...); /* *-------------------------------------------------------------------- @@ -812,7 +811,7 @@ NativeWriteReparse( *---------------------------------------------------------------------- */ -TCL_NORETURN void +MODULE_SCOPE TCL_NORETURN void tclWinDebugPanic( const char *format, ...) { -- cgit v0.12