summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-04 14:25:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-04 14:25:37 (GMT)
commit2fa48e044573693869cc6412efc1aaf4a51917bd (patch)
tree0750a60250a5adc1651eeff5c7a69e90892295ca /generic
parent6115c6c774ebf6d95e16b18fd3378d691f26722d (diff)
downloadtk-2fa48e044573693869cc6412efc1aaf4a51917bd.zip
tk-2fa48e044573693869cc6412efc1aaf4a51917bd.tar.gz
tk-2fa48e044573693869cc6412efc1aaf4a51917bd.tar.bz2
Make TCL_UNUSED() macro usable in Tk 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tkInt.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 6f40078..2f64f99 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -59,6 +59,21 @@
# endif
#endif
+#ifndef JOIN
+# define JOIN(a,b) JOIN1(a,b)
+# define JOIN1(a,b) a##b
+#endif
+
+#ifndef TCL_UNUSED
+# 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
+#endif
+
#if defined(_WIN32) && (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
# if TCL_UTF_MAX > 3
# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c)
@@ -1041,6 +1056,10 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn));
#include "tkIntDecls.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Themed widget set init function:
*/
@@ -1324,6 +1343,10 @@ MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _TKINT */
/*