diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-04-26 13:00:46 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-04-26 13:00:46 (GMT) |
commit | 3e835f1558212d3115dfac7b876343d41a79828b (patch) | |
tree | 3f9eae730bfa4b5ecc9c26208eebd61aed9d4463 | |
parent | 0ab0962567b070c7108bac68afdfc380e7c994e4 (diff) | |
parent | 85c2057c0b593be725789dfcba67e124959e71b7 (diff) | |
download | tcl-3e835f1558212d3115dfac7b876343d41a79828b.zip tcl-3e835f1558212d3115dfac7b876343d41a79828b.tar.gz tcl-3e835f1558212d3115dfac7b876343d41a79828b.tar.bz2 |
Fix [1e48483c8b]: Use of non-standard C code in TCLBOOLWARNING
-rw-r--r-- | generic/tclDecls.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index c786392..69489de 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4032,7 +4032,9 @@ extern const TclStubs *tclStubsPtr; #undef Tcl_GetIndexFromObjStruct #undef Tcl_GetBooleanFromObj #undef Tcl_GetBoolean -#ifdef __GNUC__ +#if !defined(__cplusplus) && !defined(BUILD_tcl) && !defined(BUILD_tk) +# define TCLBOOLWARNING(boolPtr) (void)(sizeof(struct {_Static_assert(sizeof(*(boolPtr)) <= sizeof(int), "sizeof(boolPtr) too large");int dummy;})), +#elif defined(__GNUC__) /* If this gives: "error: size of array ‘_bool_Var’ is negative", it means that sizeof(*boolPtr)>sizeof(int), which is not allowed */ # define TCLBOOLWARNING(boolPtr) ({__attribute__((unused)) char _bool_Var[sizeof(*(boolPtr)) > sizeof(int) ? -1 : 1];}), #else |