From 89b0bdb8829f03a5216972f59d54b3fa8a1bef16 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 7 Mar 2020 18:25:27 +0000 Subject: Move TCL_UNUSED to tclInt.h, so we can still deprecate JOIN() --- generic/tcl.h | 19 ++++--------------- generic/tclInt.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index 6aff9e7..369a894 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -81,17 +81,16 @@ extern "C" { # define STRINGIFY(x) STRINGIFY1(x) # define STRINGIFY1(x) #x #endif +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif #ifndef TCL_THREADS # define TCL_THREADS 1 #endif #endif /* !TCL_NO_DEPRECATED */ -#ifndef JOIN -# define JOIN(a,b) JOIN1(a,b) -# define JOIN1(a,b) a##b -#endif - /* * A special definition used to allow this header file to be included from * windows resource files so that they can obtain version information. @@ -147,11 +146,6 @@ extern "C" { # else # define TCL_NORETURN1 /* nothing */ # endif -# if defined(__cplusplus) -# define TCL_UNUSED(T) T -# else -# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) -# endif #else # define TCL_FORMAT_PRINTF(a,b) # if defined(_MSC_VER) && (_MSC_VER >= 1310) @@ -162,11 +156,6 @@ extern "C" { # define TCL_NOINLINE /* nothing */ # endif # define TCL_NORETURN1 /* nothing */ -# if defined(__cplusplus) -# define TCL_UNUSED(T) T -# else -# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) -# endif #endif /* diff --git a/generic/tclInt.h b/generic/tclInt.h index 6704789..9126c3b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -53,7 +53,18 @@ # endif #endif +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif +#if defined(__cplusplus) +# define TCL_UNUSED(T) T +#elif defined(__GNUC__) && (__GNUC__ > 2) +# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) +#else +# define TCL_UNUSED(T) T JOIN(dummy, __LINE__) +#endif /* * Common include files needed by most of the Tcl source files are included -- cgit v0.12