summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-07 18:25:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-07 18:25:27 (GMT)
commit89b0bdb8829f03a5216972f59d54b3fa8a1bef16 (patch)
tree73278c17cb6109836ecaafb24f992889f642b1c0
parent467d03dbc94f1e8b6ec74da6ac0f54ce4975bf10 (diff)
downloadtcl-89b0bdb8829f03a5216972f59d54b3fa8a1bef16.zip
tcl-89b0bdb8829f03a5216972f59d54b3fa8a1bef16.tar.gz
tcl-89b0bdb8829f03a5216972f59d54b3fa8a1bef16.tar.bz2
Move TCL_UNUSED to tclInt.h, so we can still deprecate JOIN()
-rw-r--r--generic/tcl.h19
-rw-r--r--generic/tclInt.h11
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