summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
commitd8f50ac067d2f0df387ca0b0c46278c2464efc8b (patch)
tree4c40167ca8b673d38459b4478944b8bc60cc4a7f /unix
parentc56ea97892bf4b5716fd0c88709b0ef0cb130995 (diff)
parenta9827f93eadc2978316098553e09406dae1f5520 (diff)
downloadtk-bug-b1d115fa60.zip
tk-bug-b1d115fa60.tar.gz
tk-bug-b1d115fa60.tar.bz2
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in2
-rwxr-xr-xunix/configure62
-rw-r--r--unix/configure.in4
-rw-r--r--unix/tcl.m461
-rw-r--r--unix/tk.spec2
-rw-r--r--unix/tkAppInit.c13
-rw-r--r--unix/tkUnix.c6
-rw-r--r--unix/tkUnix3d.c8
-rw-r--r--unix/tkUnixDefault.h1
-rw-r--r--unix/tkUnixEmbed.c1
-rw-r--r--unix/tkUnixEvent.c2
-rw-r--r--unix/tkUnixFont.c4
-rw-r--r--unix/tkUnixPort.h5
-rw-r--r--unix/tkUnixRFont.c37
14 files changed, 117 insertions, 91 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 3c48bfb..010ba48 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -285,7 +285,7 @@ CC_SEARCH_FLAGS = @CC_SEARCH_FLAGS@
LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
# support for embedded libraries on Darwin / Mac OS X
-DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR}
+DYLIB_INSTALL_DIR = $(libdir)
# support for building the Aqua resource file
TK_RSRC_FILE = @TK_RSRC_FILE@
diff --git a/unix/configure b/unix/configure
index 45c215e..0df5407 100755
--- a/unix/configure
+++ b/unix/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING CFLAGS_NOLTO LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS SHARED_BUILD RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING CFLAGS_NOLTO LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
-TK_PATCH_LEVEL=".11"
+TK_PATCH_LEVEL=".12"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -4036,6 +4036,7 @@ _ACEOF
fi
+
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
@@ -5201,7 +5202,7 @@ fi
fi
;;
- Linux*|GNU*|NetBSD-Debian)
+ Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
@@ -5215,6 +5216,20 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+
+ case $system in
+ DragonFly-*|FreeBSD-*)
+ if test "${TCL_THREADS}" = "1"; then
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+
+ ;;
+ esac
+
if test $doRpath = yes; then
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
@@ -5403,38 +5418,6 @@ fi
fi
;;
- DragonFly-*|FreeBSD-*)
- # This configuration from FreeBSD Ports.
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@"
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- if test $doRpath = yes; then
-
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
-fi
-
- if test "${TCL_THREADS}" = "1"; then
-
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
-fi
-
- case $system in
- FreeBSD-3.*)
- # Version numbers are dot-stripped by system policy.
- TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- esac
- ;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
@@ -6603,9 +6586,11 @@ fi
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*|MINGW32_*|MSYS_*) ;;
- IRIX*) ;;
- NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
+ HP-UX*) ;;
Darwin-*) ;;
+ IRIX*) ;;
+ NetBSD-*|OpenBSD-*) ;;
+ OSF1-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac
@@ -9385,7 +9370,7 @@ cat >>confdefs.h <<\_ACEOF
#define MAC_OSX_TK 1
_ACEOF
- LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit"
+ LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore"
EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c'
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
@@ -11871,6 +11856,7 @@ s,@OBJEXT@,$OBJEXT,;t t
s,@CPP@,$CPP,;t t
s,@EGREP@,$EGREP,;t t
s,@TCL_THREADS@,$TCL_THREADS,;t t
+s,@SHARED_BUILD@,$SHARED_BUILD,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@AR@,$AR,;t t
diff --git a/unix/configure.in b/unix/configure.in
index 78dd688..ecfc1e5 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -26,7 +26,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
-TK_PATCH_LEVEL=".11"
+TK_PATCH_LEVEL=".12"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -354,7 +354,7 @@ fi
if test $tk_aqua = yes; then
AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?])
- LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit"
+ LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore"
EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c'
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 8139569..6305ef7 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -519,6 +519,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [
SHARED_BUILD=0
AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
fi
+ AC_SUBST(SHARED_BUILD)
])
#------------------------------------------------------------------------
@@ -1371,7 +1372,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
])
;;
- Linux*|GNU*|NetBSD-Debian)
+ Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
@@ -1385,6 +1386,17 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+
+ case $system in
+ DragonFly-*|FreeBSD-*)
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ ;;
+ esac
+
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -1393,7 +1405,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -m64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_m64 = yes], [
CFLAGS="$CFLAGS -m64"
@@ -1490,32 +1503,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -pthread"
])
;;
- DragonFly-*|FreeBSD-*)
- # This configuration from FreeBSD Ports.
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$[@]"
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
- LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
- AS_IF([test "${TCL_THREADS}" = "1"], [
- # The -pthread needs to go in the LDFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
- case $system in
- FreeBSD-3.*)
- # Version numbers are dot-stripped by system policy.
- TCL_TRIM_DOTS=`echo ${VERSION} | tr -d .`
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- esac
- ;;
Darwin-*)
CFLAGS_OPTIMIZE="-Os"
SHLIB_CFLAGS="-fno-common"
@@ -1536,8 +1523,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_ppc64=yes],
- [tcl_cv_cc_arch_ppc64=no])
+ [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
@@ -1549,8 +1535,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -arch x86_64"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
- [tcl_cv_cc_arch_x86_64=yes],
- [tcl_cv_cc_arch_x86_64=no])
+ [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no])
CFLAGS=$hold_cflags])
AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
CFLAGS="$CFLAGS -arch x86_64"
@@ -1984,9 +1969,11 @@ dnl # preprocessing tests use only CPPFLAGS.
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*|MINGW32_*|MSYS_*) ;;
- IRIX*) ;;
- NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
+ HP-UX*) ;;
Darwin-*) ;;
+ IRIX*) ;;
+ NetBSD-*|OpenBSD-*) ;;
+ OSF1-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac])
@@ -2362,7 +2349,8 @@ AC_DEFUN([SC_TIME_HANDLER], [
# (like convex) have timezone functions, etc.
#
AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
+#include <stdlib.h>]],
[[extern long timezone;
timezone += 1;
exit (0);]])],
@@ -2374,7 +2362,8 @@ AC_DEFUN([SC_TIME_HANDLER], [
# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
#
AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
+#include <stdlib.h>]],
[[extern time_t timezone;
timezone += 1;
exit (0);]])],
diff --git a/unix/tk.spec b/unix/tk.spec
index efa3b79..91b938d 100644
--- a/unix/tk.spec
+++ b/unix/tk.spec
@@ -4,7 +4,7 @@
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
-Version: 8.6.11
+Version: 8.6.12
Release: 2
License: BSD
Group: Development/Languages
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 6cf3d42..1a2421c 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -16,12 +16,16 @@
#undef STATIC_BUILD
#include "tk.h"
#include "tkPort.h"
+#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
+# define Tcl_LibraryInitProc Tcl_PackageInitProc
+# define Tcl_StaticLibrary Tcl_StaticPackage
+#endif
#ifdef TK_TEST
#ifdef __cplusplus
extern "C" {
#endif
-extern Tcl_PackageInitProc Tktest_Init;
+extern Tcl_LibraryInitProc Tktest_Init;
#ifdef __cplusplus
}
#endif
@@ -120,12 +124,11 @@ Tcl_AppInit(
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+ Tcl_StaticLibrary(interp, "Tk", Tk_Init, Tk_SafeInit);
#if defined(USE_CUSTOM_EXIT_PROC)
if (TkpWantsExitProc()) {
- /* The cast below avoids warnings from old gcc compilers. */
- Tcl_SetExitProc((void *)TkpExitProc);
+ Tcl_SetExitProc(TkpExitProc);
}
#endif
@@ -133,7 +136,7 @@ Tcl_AppInit(
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0);
+ Tcl_StaticLibrary(interp, "Tktest", Tktest_Init, 0);
#endif /* TK_TEST */
/*
diff --git a/unix/tkUnix.c b/unix/tkUnix.c
index 2de6e98..ed024d1 100644
--- a/unix/tkUnix.c
+++ b/unix/tkUnix.c
@@ -199,8 +199,12 @@ TkpBuildRegionFromAlphaData(
long
Tk_GetUserInactiveTime(
- Display *dpy) /* The display for which to query the inactive
+ #ifdef HAVE_XSS
+ Display *dpy) /* The display for which to query the inactive
* time. */
+#else
+ TCL_UNUSED(Display *))
+#endif /* HAVE_XSS */
{
long inactiveTime = -1;
#ifdef HAVE_XSS
diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c
index 7ea67a1..2f2475b 100644
--- a/unix/tkUnix3d.c
+++ b/unix/tkUnix3d.c
@@ -4,7 +4,7 @@
* This file contains the platform specific routines for drawing 3d
* borders in the Motif style.
*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
+ * Copyright (c) 1996 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,7 +13,9 @@
#include "tkInt.h"
#include "tk3d.h"
-#if !(defined(_WIN32) || defined(MAC_OSX_TK))
+#if defined(MAC_OSX_TK)
+#include "tkMacOSXInt.h"
+#else
#include "tkUnixInt.h"
#endif
@@ -46,7 +48,7 @@ typedef struct {
TkBorder *
TkpGetBorder(void)
{
- UnixBorder *borderPtr = ckalloc(sizeof(UnixBorder));
+ UnixBorder *borderPtr = (UnixBorder *)ckalloc(sizeof(UnixBorder));
borderPtr->solidGC = NULL;
return (TkBorder *) borderPtr;
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index 3e9ef97..a3d50b6 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -54,6 +54,7 @@
#define DEF_BUTTON_DEFAULT "disabled"
#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
#define DEF_BUTTON_DISABLED_FG_MONO ""
+#define DEF_LABEL_FG BLACK
#define DEF_BUTTON_FG BLACK
#define DEF_CHKRAD_FG DEF_BUTTON_FG
#define DEF_BUTTON_FONT "TkDefaultFont"
diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c
index a33a623..ff7860b 100644
--- a/unix/tkUnixEmbed.c
+++ b/unix/tkUnixEmbed.c
@@ -979,6 +979,7 @@ EmbedWindowDeleted(
prevPtr = NULL;
containerPtr = tsdPtr->firstContainerPtr;
while (1) {
+ if (containerPtr == NULL) return;
if (containerPtr->embeddedPtr == winPtr) {
containerPtr->wrapper = None;
containerPtr->embeddedPtr = NULL;
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 4d0b9be..e424bb7 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -15,7 +15,7 @@
#ifdef HAVE_XKBKEYCODETOKEYSYM
# include <X11/XKBlib.h>
#else
-# define XkbOpenDisplay(D,V,E,M,m,R) ((V),(E),(M),(m),(R),(NULL))
+# define XkbOpenDisplay(D,V,E,M,m,R) (((void)D),((void)V),((void)E),((void)M),((void)m),((void)R),(NULL))
#endif
/*
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index bd83a5e..665b260 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -2763,9 +2763,9 @@ GetScreenFont(
FontAttributes *wantPtr, /* Contains desired actual pixel-size if the
* best font was scalable. */
char **nameList, /* Array of XLFDs. */
- int bestIdx[2], /* Indices into above array for XLFD of best
+ int bestIdx[], /* Indices into above array for XLFD of best
* bitmapped and best scalable font. */
- unsigned bestScore[2]) /* Scores of best bitmapped and best scalable
+ unsigned bestScore[]) /* Scores of best bitmapped and best scalable
* font. XLFD corresponding to lowest score
* will be constructed. */
{
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 7c6177e..44926a4 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -58,6 +58,9 @@
#else
# include "../compat/unistd.h"
#endif
+#if defined(__GNUC__) && !defined(__cplusplus)
+# pragma GCC diagnostic ignored "-Wc++-compat"
+#endif
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
@@ -188,7 +191,7 @@
#ifndef __CYGWIN__
#define TkpPrintWindowId(buf,w) \
- sprintf((buf), "%#08lx", (unsigned long) (w))
+ sprintf((buf), "0x%08lx", (unsigned long) (w))
#endif
/*
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 226445c..8eb6f53 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -53,6 +53,10 @@ typedef struct {
Region clipRegion; /* The clipping region, or None. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+
+TCL_DECLARE_MUTEX(xftMutex);
+#define LOCK Tcl_MutexLock(&xftMutex)
+#define UNLOCK Tcl_MutexUnlock(&xftMutex)
/*
* Package initialization:
@@ -122,7 +126,9 @@ GetFont(
if (angle != 0.0) {
FcPatternAddMatrix(pat, FC_MATRIX, &mat);
}
+ LOCK;
ftFont = XftFontOpenPattern(fontPtr->display, pat);
+ UNLOCK;
if (!ftFont) {
/*
* The previous call to XftFontOpenPattern() should not fail, but
@@ -131,11 +137,13 @@ GetFont(
* fallback:
*/
+ LOCK;
ftFont = XftFontOpen(fontPtr->display, fontPtr->screen,
FC_FAMILY, FcTypeString, "sans",
FC_SIZE, FcTypeDouble, 12.0,
FC_MATRIX, FcTypeMatrix, &mat,
NULL);
+ UNLOCK;
}
if (!ftFont) {
/*
@@ -150,7 +158,9 @@ GetFont(
fontPtr->faces[i].ft0Font = ftFont;
} else {
if (fontPtr->faces[i].ftFont) {
+ LOCK;
XftFontClose(fontPtr->display, fontPtr->faces[i].ftFont);
+ UNLOCK;
}
fontPtr->faces[i].ftFont = ftFont;
fontPtr->faces[i].angle = angle;
@@ -409,10 +419,14 @@ FinishedWithFont(
for (i = 0; i < fontPtr->nfaces; i++) {
if (fontPtr->faces[i].ftFont) {
+ LOCK;
XftFontClose(fontPtr->display, fontPtr->faces[i].ftFont);
+ UNLOCK;
}
if (fontPtr->faces[i].ft0Font) {
+ LOCK;
XftFontClose(fontPtr->display, fontPtr->faces[i].ft0Font);
+ UNLOCK;
}
if (fontPtr->faces[i].charset) {
FcCharSetDestroy(fontPtr->faces[i].charset);
@@ -751,7 +765,9 @@ Tk_MeasureChars(
ftFont = GetFont(fontPtr, c, 0.0);
if (!errorFlag) {
+ LOCK;
XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
+ UNLOCK;
} else {
extents.xOff = 0;
errorFlag = 0;
@@ -962,8 +978,10 @@ Tk_DrawChars(
ftFont = GetFont(fontPtr, c, 0.0);
if (ftFont) {
specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
+ LOCK;
XftGlyphExtents(fontPtr->display, ftFont, &specs[nspec].glyph, 1,
&metrics);
+ UNLOCK;
/*
* Draw glyph only when it fits entirely into 16 bit coords.
@@ -976,8 +994,10 @@ Tk_DrawChars(
specs[nspec].x = x;
specs[nspec].y = y;
if (++nspec == NUM_SPEC) {
+ LOCK;
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
+ UNLOCK;
nspec = 0;
}
}
@@ -986,7 +1006,9 @@ Tk_DrawChars(
}
}
if (nspec) {
+ LOCK;
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor, specs, nspec);
+ UNLOCK;
}
doUnderlineStrikeout:
@@ -1113,8 +1135,11 @@ TkDrawAngledChars(
* this information... but we'll be ready when it does!
*/
+ LOCK;
XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
nglyph, &metrics);
+ UNLOCK;
+
/*
* Draw glyph only when it fits entirely into 16 bit coords.
*/
@@ -1137,8 +1162,10 @@ TkDrawAngledChars(
* a very small barely readable font)
*/
+ LOCK;
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
+ UNLOCK;
}
}
originX = ROUND16(x);
@@ -1148,8 +1175,10 @@ TkDrawAngledChars(
glyphs[nglyph++] = XftCharIndex(fontPtr->display, ftFont, c);
}
if (nglyph) {
+ LOCK;
XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
nglyph, &metrics);
+ UNLOCK;
/*
* Draw glyph only when it fits entirely into 16 bit coords.
@@ -1158,8 +1187,10 @@ TkDrawAngledChars(
if (x >= minCoord && y >= minCoord &&
x <= maxCoord - metrics.width &&
y <= maxCoord - metrics.height) {
+ LOCK;
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
+ UNLOCK;
}
}
#else /* !XFT_HAS_FIXED_ROTATED_PLACEMENT */
@@ -1207,8 +1238,10 @@ TkDrawAngledChars(
ft0Font = GetFont(fontPtr, c, 0.0);
if (ftFont && ft0Font) {
specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
+ LOCK;
XftGlyphExtents(fontPtr->display, ft0Font, &specs[nspec].glyph, 1,
&metrics);
+ UNLOCK;
/*
* Draw glyph only when it fits entirely into 16 bit coords.
@@ -1221,8 +1254,10 @@ TkDrawAngledChars(
specs[nspec].x = ROUND16(x);
specs[nspec].y = ROUND16(y);
if (++nspec == NUM_SPEC) {
+ LOCK;
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
+ UNLOCK;
nspec = 0;
}
}
@@ -1231,7 +1266,9 @@ TkDrawAngledChars(
}
}
if (nspec) {
+ LOCK;
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor, specs, nspec);
+ UNLOCK;
}
#endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */