summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tk.h2
-rw-r--r--generic/tkDecls.h1
-rw-r--r--generic/tkImgPhoto.c28
-rw-r--r--generic/tkOldTest.c8
-rw-r--r--generic/tkStubInit.c1
-rw-r--r--tests/image.test6
-rwxr-xr-xunix/configure15
-rw-r--r--unix/tcl.m415
8 files changed, 52 insertions, 24 deletions
diff --git a/generic/tk.h b/generic/tk.h
index c2be29c..012e3ff 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -1301,7 +1301,7 @@ typedef struct Tk_Outline {
*/
typedef struct Tk_ImageType Tk_ImageType;
-#ifdef USE_OLD_IMAGE
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE)
typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
char **argv, Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *masterDataPtr);
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 7b583b8..f1b3640 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -1766,6 +1766,7 @@ extern const TkStubs *tkStubsPtr;
#undef Tk_PhotoPutBlock_Panic
#undef Tk_PhotoPutZoomedBlock_Panic
#undef Tk_PhotoSetSize_Panic
+#undef Tk_CreateOldPhotoImageFormat
#endif /* TK_NO_DEPRECATED */
#undef TCL_STORAGE_CLASS
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 126c43d..b93f0fb 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -139,9 +139,11 @@ typedef struct {
Tk_PhotoImageFormat *formatList;
/* Pointer to the first in the list of known
* photo image formats.*/
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
Tk_PhotoImageFormat *oldFormatList;
/* Pointer to the first in the list of known
* photo image formats.*/
+#endif
Tk_PhotoImageFormatVersion3 *formatListVersion3;
/* Pointer to the first in the list of known
* photo image formats in Version3 format.*/
@@ -243,11 +245,13 @@ PhotoFormatThreadExitProc(
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
(void)dummy;
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
while (tsdPtr->oldFormatList != NULL) {
freePtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
ckfree(freePtr);
}
+#endif
while (tsdPtr->formatList != NULL) {
freePtr = tsdPtr->formatList;
tsdPtr->formatList = tsdPtr->formatList->nextPtr;
@@ -282,6 +286,7 @@ PhotoFormatThreadExitProc(
*----------------------------------------------------------------------
*/
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
void
Tk_CreateOldPhotoImageFormat(
const Tk_PhotoImageFormat *formatPtr)
@@ -302,6 +307,7 @@ Tk_CreateOldPhotoImageFormat(
copyPtr->nextPtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = copyPtr;
}
+#endif
void
Tk_CreatePhotoImageFormat(
@@ -320,10 +326,13 @@ Tk_CreatePhotoImageFormat(
}
copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
if (isupper((unsigned char) *formatPtr->name)) {
copyPtr->nextPtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = copyPtr;
- } else {
+ } else
+#endif
+ {
/* for compatibility with aMSN: make a copy of formatPtr->name */
char *name = (char *)ckalloc(strlen(formatPtr->name) + 1);
strcpy(name, formatPtr->name);
@@ -340,6 +349,7 @@ Tk_CreatePhotoImageFormatVersion3(
* by caller. */
{
Tk_PhotoImageFormatVersion3 *copyPtr;
+ char *name;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -351,7 +361,7 @@ Tk_CreatePhotoImageFormatVersion3(
ckalloc(sizeof(Tk_PhotoImageFormatVersion3));
*copyPtr = *formatPtr;
/* for compatibility with aMSN: make a copy of formatPtr->name */
- char *name = (char *)ckalloc(strlen(formatPtr->name) + 1);
+ name = (char *)ckalloc(strlen(formatPtr->name) + 1);
strcpy(name, formatPtr->name);
copyPtr->name = name;
copyPtr->nextPtr = tsdPtr->formatListVersion3;
@@ -809,6 +819,7 @@ ImgPhotoCmd(
}
}
}
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
if (stringWriteProc == NULL) {
oldformat = 1;
for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
@@ -824,6 +835,7 @@ ImgPhotoCmd(
}
}
}
+#endif
if (stringWriteProc == NULL) {
oldformat = 0;
for (imageFormatVersion3 = tsdPtr->formatListVersion3;
@@ -1494,6 +1506,7 @@ readCleanup:
}
}
}
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
if (imageFormat == NULL) {
oldformat = 1;
for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
@@ -1523,6 +1536,7 @@ readCleanup:
}
}
}
+#endif
if (usedExt && !matched) {
/*
* If we didn't find one and we're using file extensions as the
@@ -2729,7 +2743,7 @@ MatchFileFormat(
Tcl_DString *driverInternalPtr)/* Memory to be passed to the corresponding
* ReadFileFormat function */
{
- int matched = 0, useoldformat = 0, useVersion3format = 0;
+ int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr;
Tk_PhotoImageFormatVersion3 *formatVersion3Ptr;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -2777,7 +2791,8 @@ MatchFileFormat(
}
}
}
- if (formatPtr == NULL) {
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+if (formatPtr == NULL) {
useoldformat = 1;
for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
formatPtr = formatPtr->nextPtr) {
@@ -2811,6 +2826,7 @@ MatchFileFormat(
}
}
}
+#endif
/*
* For old and not Version3 format, exit now with success
@@ -2933,7 +2949,7 @@ MatchStringFormat(
Tcl_DString *driverInternalPtr)/* Memory to be passed to the corresponding
* ReadFileFormat function */
{
- int matched = 0, useoldformat = 0, useVersion3format = 0;
+ int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr, *defaultFormatPtr = NULL;
Tk_PhotoImageFormatVersion3 *formatVersion3Ptr = NULL;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -2994,6 +3010,7 @@ MatchStringFormat(
}
}
+#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
if (formatPtr == NULL) {
useoldformat = 1;
for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
@@ -3023,6 +3040,7 @@ MatchStringFormat(
}
}
}
+#endif
if (formatPtr == NULL) {
useoldformat = 0;
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
index d9e8053..0702347 100644
--- a/generic/tkOldTest.c
+++ b/generic/tkOldTest.c
@@ -24,6 +24,7 @@
#endif
#include "tkInt.h"
+#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
/*
* The following data structure represents the master for a test image:
*/
@@ -84,7 +85,7 @@ static Tk_ImageType imageType = {
static int ImageObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj * const objv[]);
-
+#endif
/*
*----------------------------------------------------------------------
@@ -113,7 +114,9 @@ TkOldTestInit(
if (!initialized) {
initialized = 1;
+#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
Tk_CreateImageType(&imageType);
+#endif
}
return TCL_OK;
}
@@ -133,7 +136,7 @@ TkOldTestInit(
*
*----------------------------------------------------------------------
*/
-
+#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
static int
ImageCreate(
Tcl_Interp *interp, /* Interpreter for application containing
@@ -400,6 +403,7 @@ ImageDelete(
ckfree(timPtr->varName);
ckfree(timPtr);
}
+#endif
/*
* Local Variables:
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index fe91998..66834e6 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -70,6 +70,7 @@ static int TkWinGetPlatformId(void) {
#define Tk_PhotoPutBlock_Panic 0
#define Tk_PhotoPutZoomedBlock_Panic 0
#define Tk_PhotoSetSize_Panic 0
+#define Tk_CreateOldPhotoImageFormat 0
#else
static void
doNothing(void)
diff --git a/tests/image.test b/tests/image.test
index da65a66..ee3f3d9 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -308,11 +308,13 @@ test image-5.7 {Tk_ImageCmd procedure, "type" option} -constraints {
} -returnCodes error -result {image "myimage" doesn't exist}
-test image-6.1 {Tk_ImageCmd procedure, "types" option} -body {
+test image-6.1 {Tk_ImageCmd procedure, "types" option} -constraints {
+ testImageType
+} -body {
image types x
} -returnCodes error -result {wrong # args: should be "image types"}
test image-6.2 {Tk_ImageCmd procedure, "types" option} -constraints {
- testImageType
+ testOldImageType
} -body {
lsort [image types]
} -result {bitmap oldtest photo test}
diff --git a/unix/configure b/unix/configure
index dceb0a1..13c36a9 100755
--- a/unix/configure
+++ b/unix/configure
@@ -4241,7 +4241,7 @@ fi
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
case "${CC}" in
- *++)
+ *++|*++-*)
;;
*)
CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
@@ -4514,7 +4514,7 @@ fi
LD_SEARCH_FLAGS=""
;;
CYGWIN_*)
- SHLIB_CFLAGS=""
+ SHLIB_CFLAGS="-fno-common"
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
DL_OBJS="tclLoadDl.o"
@@ -4897,7 +4897,7 @@ fi
fi
;;
Linux*|GNU*|NetBSD-Debian)
- SHLIB_CFLAGS="-fPIC"
+ SHLIB_CFLAGS="-fPIC -fno-common"
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -5033,7 +5033,6 @@ 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"
@@ -5421,7 +5420,6 @@ fi
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
- SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
@@ -5765,9 +5763,12 @@ fi
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*) ;;
- IRIX*) ;;
- NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
+ HP_UX*) ;;
Darwin-*) ;;
+ IRIX*) ;;
+ Linux*|GNU*) ;;
+ NetBSD-*|OpenBSD-*) ;;
+ OSF1-V*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 0a2920b..aed464f 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -968,7 +968,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
case "${CC}" in
- *++)
+ *++|*++-*)
;;
*)
CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
@@ -1084,7 +1084,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LD_SEARCH_FLAGS=""
;;
CYGWIN_*)
- SHLIB_CFLAGS=""
+ SHLIB_CFLAGS="-fno-common"
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
DL_OBJS="tclLoadDl.o"
@@ -1269,7 +1269,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
;;
Linux*|GNU*|NetBSD-Debian)
- SHLIB_CFLAGS="-fPIC"
+ SHLIB_CFLAGS="-fPIC -fno-common"
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2"
@@ -1364,7 +1364,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
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"
@@ -1558,7 +1557,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
- SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
@@ -1786,9 +1784,12 @@ dnl # preprocessing tests use only CPPFLAGS.
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*) ;;
- IRIX*) ;;
- NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
+ HP_UX*) ;;
Darwin-*) ;;
+ IRIX*) ;;
+ Linux*|GNU*) ;;
+ NetBSD-*|OpenBSD-*) ;;
+ OSF1-V*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac])