summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2006-01-10 05:37:49 (GMT)
committerdas <das>2006-01-10 05:37:49 (GMT)
commit11aeb4c3fa20ad6af8f7d092fc49b00209abf120 (patch)
tree967c3ee56a6db04059d4b910e916fb987df45557 /macosx
parent0abfb7e9f17a833ae91b0bfdc5d8a7d7726e37d2 (diff)
downloadtk-11aeb4c3fa20ad6af8f7d092fc49b00209abf120.zip
tk-11aeb4c3fa20ad6af8f7d092fc49b00209abf120.tar.gz
tk-11aeb4c3fa20ad6af8f7d092fc49b00209abf120.tar.bz2
* macosx/tkMacOSXDebug.c: add TkMacOSXGetNamedDebugSymbol() function
* macosx/tkMacOSXDebug.h: that finds unexported symbols in loaded libraries by manually walking their symbol table; only to be used for debugging purposes, may break unexpectedly in the future. Needed to get access to private_extern internal debugging functions in HIToolbox. * macosx/tkMacOSXCarbonEvents.c: fix debug event tracing on Tiger. * macosx/tkMacOSXMenu.c: add debug menu printing during reconfigure. * macosx/tkMacOSXInit.c: conditionalize 64bit-unsafe dyld code. * macosx/GNUmakefile: add 'wish8.x' symlink to SYMROOT. * macosx/Wish.xcode/project.pbxproj: fix copy to tktest resource * macosx/Wish.xcodeproj/project.pbxproj: fork when zerolinked. * macosx/Wish.xcode/default.pbxuser: add widget demo as argument to * macosx/Wish.xcodeproj/default.pbxuser: executables (on by default). * unix/configure: add caching, use AC_CACHE_CHECK instead of * unix/configure.in: AC_CACHE_VAL where possible, consistent message * unix/tcl.m4: quoting, sync relevant tclconfig/tcl.m4 changes and gratuitous formatting differences, fix SC_CONFIG_MANPAGES with default argument, Darwin improvements to SC_LOAD_*CONFIG.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/GNUmakefile5
-rw-r--r--macosx/Wish.xcode/default.pbxuser8
-rw-r--r--macosx/Wish.xcode/project.pbxproj2
-rw-r--r--macosx/Wish.xcodeproj/default.pbxuser8
-rw-r--r--macosx/Wish.xcodeproj/project.pbxproj2
-rw-r--r--macosx/tkMacOSXCarbonEvents.c60
-rw-r--r--macosx/tkMacOSXDebug.c134
-rw-r--r--macosx/tkMacOSXDebug.h11
-rw-r--r--macosx/tkMacOSXInit.c6
-rw-r--r--macosx/tkMacOSXMenu.c20
10 files changed, 209 insertions, 47 deletions
diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile
index c4a458c..9740151 100644
--- a/macosx/GNUmakefile
+++ b/macosx/GNUmakefile
@@ -4,7 +4,7 @@
# uses the standard unix build system in tk/unix (which can be used directly instead of this
# if you are not using the tk/macosx projects).
#
-# RCS: @(#) $Id: GNUmakefile,v 1.2 2005/11/27 02:36:14 das Exp $
+# RCS: @(#) $Id: GNUmakefile,v 1.3 2006/01/10 05:37:51 das Exp $
#
########################################################################################################
@@ -186,7 +186,8 @@ build-${PROJECT}: ${OBJ_DIR}/Makefile
rm -rf ./${LIBDIR} ./${BINDIR} && ln -fs ${SYMROOT} ./${LIBDIR} && \
ln -fs ${SYMROOT} ./${BINDIR} && ln -fs ${OBJ_DIR}/tktest ${SYMROOT}
ifeq (${TK_X11},)
- @rm -f ${OBJ_DIR}/${BINDIR}
+ @rm -f ${OBJ_DIR}/${BINDIR} && \
+ ln -fs Wish.app/Contents/MacOS/Wish ${SYMROOT}/${WISH}
endif
# Create symbolic link to Tcl.framework in ${SYMROOT}if necessary
@cd ${SYMROOT} && if [ ! -e Tcl.framework -o -L Tcl.framework ]; then \
diff --git a/macosx/Wish.xcode/default.pbxuser b/macosx/Wish.xcode/default.pbxuser
index c742c7f..164d686 100644
--- a/macosx/Wish.xcode/default.pbxuser
+++ b/macosx/Wish.xcode/default.pbxuser
@@ -24,13 +24,15 @@
);
};
F944EB8F08F798100049FDD4 = {
- activeArgIndex = 2147483647;
+ activeArgIndex = 0;
activeArgIndices = (
+ YES,
NO,
NO,
NO,
);
argumentStrings = (
+ "${SRCROOT}/../../tk/library/demos/widget",
"${SRCROOT}/../../tcl/tests/all.tcl",
"${SRCROOT}/../../tk/tests/all.tcl",
"-verbose \"\"",
@@ -118,10 +120,12 @@
activeExec = 0;
};
F9E61D1C090A4282002B3151 = {
- activeArgIndex = 2147483647;
+ activeArgIndex = 0;
activeArgIndices = (
+ YES,
);
argumentStrings = (
+ "${SRCROOT}/../../tk/library/demos/widget",
);
configStateDict = {
"PBXLSLaunchAction-0" = {
diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj
index 79e5cb4..6049eb4 100644
--- a/macosx/Wish.xcode/project.pbxproj
+++ b/macosx/Wish.xcode/project.pbxproj
@@ -14306,7 +14306,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TEMP_DIR}/stamp\"\n\n## Ensure other buildstyles are relinked next time they are built:\ncd \"${OBJROOT}/${PROJECT_NAME}.build\" &&\nfor d in $(find . -maxdepth 1 -type d -name '*.build' ! -name \"${PROJECT_TEMP_DIR##*/}\"); do\n for v in ${BUILD_VARIANTS}; do\n o=\"$d/${TARGET_NAME}.build/Objects-${v}\" &&\n for a in ${ARCHS}; do touch -c -r \"${TEMP_DIR}/stamp\" \"$o/$a/tkAppInit.o\"; done\n done\ndone\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/rsrc\"\nfi\n";
+ shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TEMP_DIR}/stamp\"\n\n## Ensure other buildstyles are relinked next time they are built:\ncd \"${OBJROOT}/${PROJECT_NAME}.build\" &&\nfor d in $(find . -maxdepth 1 -type d -name '*.build' ! -name \"${PROJECT_TEMP_DIR##*/}\"); do\n for v in ${BUILD_VARIANTS}; do\n o=\"$d/${TARGET_NAME}.build/Objects-${v}\" &&\n for a in ${ARCHS}; do touch -c -r \"${TEMP_DIR}/stamp\" \"$o/$a/tkAppInit.o\"; done\n done\ndone\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/..namedfork/rsrc\"\nfi\n";
};
F9903CAF094FAADA004613E9 = {
explicitFileType = text.script;
diff --git a/macosx/Wish.xcodeproj/default.pbxuser b/macosx/Wish.xcodeproj/default.pbxuser
index 584b1f0..1695fa5 100644
--- a/macosx/Wish.xcodeproj/default.pbxuser
+++ b/macosx/Wish.xcodeproj/default.pbxuser
@@ -26,13 +26,15 @@
};
F944EB8F08F798100049FDD4 /* tktest */ = {
isa = PBXExecutable;
- activeArgIndex = 2147483647;
+ activeArgIndex = 0;
activeArgIndices = (
+ YES,
NO,
NO,
NO,
);
argumentStrings = (
+ "${SRCROOT}/../../tk/library/demos/widget",
"${SRCROOT}/../../tcl/tests/all.tcl",
"${SRCROOT}/../../tk/tests/all.tcl",
"-verbose \"\"",
@@ -111,10 +113,12 @@
};
F9E61D1C090A4282002B3151 /* Wish */ = {
isa = PBXExecutable;
- activeArgIndex = 2147483647;
+ activeArgIndex = 0;
activeArgIndices = (
+ YES,
);
argumentStrings = (
+ "${SRCROOT}/../../tk/library/demos/widget",
);
autoAttachOnCrash = 1;
configStateDict = {
diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj
index 242c1af..29331fc 100644
--- a/macosx/Wish.xcodeproj/project.pbxproj
+++ b/macosx/Wish.xcodeproj/project.pbxproj
@@ -3358,7 +3358,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/rsrc\"\nfi\n";
+ shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/..namedfork/rsrc\"\nfi\n";
};
F9A5C5F508F651A2008AE941 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
diff --git a/macosx/tkMacOSXCarbonEvents.c b/macosx/tkMacOSXCarbonEvents.c
index c4aca8d..def8bd8 100644
--- a/macosx/tkMacOSXCarbonEvents.c
+++ b/macosx/tkMacOSXCarbonEvents.c
@@ -60,7 +60,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.8 2005/12/13 03:44:34 das Exp $
+ * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.9 2006/01/10 05:37:51 das Exp $
*/
#include "tkInt.h"
@@ -119,13 +119,13 @@ CarbonEventHandlerProc (
macEvent.interp = (Tcl_Interp *) userData;
bzero(&eventStatus, sizeof(eventStatus));
-#ifdef TK_MAC_DEBUG_CARBON_EVENTS
+#if defined(TK_MAC_DEBUG) && defined(TK_MAC_DEBUG_CARBON_EVENTS)
char buf [256];
if (macEvent.eKind != kEventMouseMoved &&
macEvent.eKind != kEventMouseDragged) {
CarbonEventToAscii(event, buf);
fprintf(stderr, "CarbonEventHandlerProc started handling %s\n", buf);
- TkMacOSXInitNamedSymbol(HIToolbox, void, _DebugPrintEvent,
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, void, _DebugPrintEvent,
EventRef inEvent);
if (_DebugPrintEvent) {
/* Carbon-internal event debugging (c.f. Technote 2124) */
@@ -139,7 +139,7 @@ CarbonEventHandlerProc (
result = noErr;
}
-#ifdef TK_MAC_DEBUG_CARBON_EVENTS
+#if defined(TK_MAC_DEBUG) && defined(TK_MAC_DEBUG_CARBON_EVENTS)
if (macEvent.eKind != kEventMouseMoved &&
macEvent.eKind != kEventMouseDragged) {
fprintf(stderr,
@@ -225,32 +225,32 @@ TkMacOSXInitCarbonEvents (
#endif
}
-#ifdef TK_MAC_DEBUG_CARBON_EVENTS
- TkMacOSXInitNamedSymbol(HIToolbox, void, _TraceEventByName, CFStringRef);
- if (_TraceEventByName) {
+#if defined(TK_MAC_DEBUG) && defined(TK_MAC_DEBUG_CARBON_EVENTS)
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, void, TraceEventByName, char*);
+ if (TraceEventByName) {
/* Carbon-internal event debugging (c.f. Technote 2124) */
- _TraceEventByName(CFSTR("kEventMouseDown"));
- _TraceEventByName(CFSTR("kEventMouseUp"));
- _TraceEventByName(CFSTR("kEventMouseWheelMoved"));
- _TraceEventByName(CFSTR("kEventMouseScroll"));
- _TraceEventByName(CFSTR("kEventWindowUpdate"));
- _TraceEventByName(CFSTR("kEventWindowActivated"));
- _TraceEventByName(CFSTR("kEventWindowDeactivated"));
- _TraceEventByName(CFSTR("kEventRawKeyDown"));
- _TraceEventByName(CFSTR("kEventRawKeyRepeat"));
- _TraceEventByName(CFSTR("kEventRawKeyUp"));
- _TraceEventByName(CFSTR("kEventRawKeyModifiersChanged"));
- _TraceEventByName(CFSTR("kEventRawKeyRepeat"));
- _TraceEventByName(CFSTR("kEventAppActivated"));
- _TraceEventByName(CFSTR("kEventAppDeactivated"));
- _TraceEventByName(CFSTR("kEventAppQuit"));
- _TraceEventByName(CFSTR("kEventMenuBeginTracking"));
- _TraceEventByName(CFSTR("kEventMenuEndTracking"));
- _TraceEventByName(CFSTR("kEventCommandProcess"));
- _TraceEventByName(CFSTR("kEventWindowExpanded"));
- _TraceEventByName(CFSTR("kEventAppHidden"));
- _TraceEventByName(CFSTR("kEventAppShown"));
- _TraceEventByName(CFSTR("kEventAppAvailableWindowBoundsChanged"));
+ TraceEventByName("kEventMouseDown");
+ TraceEventByName("kEventMouseUp");
+ TraceEventByName("kEventMouseWheelMoved");
+ TraceEventByName("kEventMouseScroll");
+ TraceEventByName("kEventWindowUpdate");
+ TraceEventByName("kEventWindowActivated");
+ TraceEventByName("kEventWindowDeactivated");
+ TraceEventByName("kEventRawKeyDown");
+ TraceEventByName("kEventRawKeyRepeat");
+ TraceEventByName("kEventRawKeyUp");
+ TraceEventByName("kEventRawKeyModifiersChanged");
+ TraceEventByName("kEventRawKeyRepeat");
+ TraceEventByName("kEventAppActivated");
+ TraceEventByName("kEventAppDeactivated");
+ TraceEventByName("kEventAppQuit");
+ TraceEventByName("kEventMenuBeginTracking");
+ TraceEventByName("kEventMenuEndTracking");
+ TraceEventByName("kEventCommandProcess");
+ TraceEventByName("kEventWindowExpanded");
+ TraceEventByName("kEventAppHidden");
+ TraceEventByName("kEventAppShown");
+ TraceEventByName("kEventAppAvailableWindowBoundsChanged");
}
#endif /* TK_MAC_DEBUG_CARBON_EVENTS */
}
@@ -380,7 +380,7 @@ CarbonTimerProc (
{
while(carbonTimerEnabled && Tcl_DoOneEvent(
TCL_FILE_EVENTS|TCL_TIMER_EVENTS|TCL_DONT_WAIT)) {
-#ifdef TK_MAC_DEBUG_CARBON_EVENTS
+#if defined(TK_MAC_DEBUG) && defined(TK_MAC_DEBUG_CARBON_EVENTS)
fprintf(stderr, "Processed tcl event from carbon timer\n");
#endif /* TK_MAC_DEBUG_CARBON_EVENTS */
}
diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c
index 9997886..61f8418 100644
--- a/macosx/tkMacOSXDebug.c
+++ b/macosx/tkMacOSXDebug.c
@@ -50,13 +50,17 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.6 2005/11/27 02:36:14 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.7 2006/01/10 05:37:51 das Exp $
*/
+#include "tkMacOSXInt.h"
#include "tkMacOSXDebug.h"
#ifdef TK_MAC_DEBUG
+#include <mach-o/dyld.h>
+#include <mach-o/nlist.h>
+
typedef struct {
EventKind kind;
char * name;
@@ -447,5 +451,133 @@ MouseTrackingResultToAscii(MouseTrackingResult r, char * buf)
sprintf(buf, "Unknown mouse tracking result : %d", r);
return buf;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNamedDebugSymbol --
+ *
+ *
+ * Dynamically acquire address of a named symbol from a loaded
+ * dynamic library, so that we can use API that may not be
+ * available on all OS versions.
+ * For debugging purposes, if we cannot find the symbol with the
+ * usual dynamic library APIs, we manually walk the symbol table
+ * of the loaded library. This allows access to unexported
+ * symbols such as private_extern internal debugging functions.
+ * If module is NULL or the empty string, search all loaded
+ * libraries (could be very expensive and should be avoided).
+ *
+ * THIS FUCTION IS ONLY TO BE USED FOR DEBUGGING PURPOSES, IT MAY
+ * BREAK UNEXPECTEDLY IN THE FUTURE !
+ *
+ * Results:
+ * Address of given symbol or NULL if unavailable.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void *
+TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol)
+{
+ void* addr = TkMacOSXGetNamedSymbol(module, symbol);
+#ifndef __LP64__
+ if (!addr) {
+ const struct mach_header *mh = NULL;
+ uint32_t i, n = _dyld_image_count();
+
+ for (i = 0; i < n; i++) {
+ if (module && *module) {
+ /* Find image with given module name */
+ char *name;
+ const char *path = _dyld_get_image_name(i);
+
+ if (!path) {
+ continue;
+ }
+ name = strrchr(path, '/') + 1;
+ if (strncmp(name, module, strlen(name)) != 0) {
+ continue;
+ }
+ }
+ mh = _dyld_get_image_header(i);
+ if (mh) {
+ struct load_command *lc;
+ struct symtab_command *st = NULL;
+ struct segment_command *sg = NULL;
+ uint32_t j, m, nsect = 0, txtsectx = 0;
+
+ lc = (struct load_command*)((char *) mh +
+ sizeof(struct mach_header));
+ m = mh->ncmds;
+ for (j = 0; j < m; j++) {
+ /* Find symbol table and index of __text section */
+ if (lc->cmd == LC_SEGMENT) {
+ /* Find last segment before symbol table */
+ sg = (struct segment_command*) lc;
+ if (!txtsectx) {
+ /* Count total sections until (__TEXT, __text) */
+ uint32_t k, ns = sg->nsects;
+
+ if (strcmp(sg->segname, SEG_TEXT) == 0) {
+ struct section *s = (struct section *)(
+ (char *)sg +
+ sizeof(struct segment_command));
+
+ for(k = 0; k < ns; k++) {
+ if (strcmp(s->sectname, SECT_TEXT) == 0) {
+ txtsectx = nsect+k+1;
+ break;
+ }
+ s++;
+ }
+ }
+ nsect += ns;
+ }
+ } else if (!st && lc->cmd == LC_SYMTAB) {
+ st = (struct symtab_command*) lc;
+ break;
+ }
+ lc = (struct load_command *)((char *) lc + lc->cmdsize);
+ }
+ if (st && sg && txtsectx) {
+ intptr_t base, slide = _dyld_get_image_vmaddr_slide(i);
+ char *strings;
+ struct nlist *sym;
+ uint32_t strsize = st->strsize;
+ int32_t strx;
+
+ /* Offset file positions by difference to actual position
+ in memory of last segment before symbol table: */
+ base = (intptr_t) sg->vmaddr + slide - sg->fileoff;
+ strings = (char*)(base + st->stroff);
+ sym = (struct nlist*)(base + st->symoff);
+ m = st->nsyms;
+ for (j = 0; j < m; j++) {
+ /* Find symbol with given name in __text section */
+ strx = sym->n_un.n_strx;
+ if ((sym->n_type & N_TYPE) == N_SECT &&
+ sym->n_sect == txtsectx &&
+ strx > 0 && strx < strsize &&
+ strcmp(strings + strx, symbol) == 0) {
+ addr = (void*) sym->n_value + slide;
+ break;
+ }
+ sym++;
+ }
+ }
+ }
+ if (module && *module) {
+ /* If given a module name, only search corresponding image */
+ break;
+ }
+ }
+ }
+#endif /* __LP64__ */
+ return addr;
+}
#endif /* TK_MAC_DEBUG */
diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h
index 5abe734..7039b36 100644
--- a/macosx/tkMacOSXDebug.h
+++ b/macosx/tkMacOSXDebug.h
@@ -50,7 +50,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.6 2005/11/27 02:36:14 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.7 2006/01/10 05:37:51 das Exp $
*/
#ifndef _TKMACDEBUG
@@ -79,6 +79,15 @@ MODULE_SCOPE char * TkMacOSXMenuMessageToAscii(int msg, char * s);
MODULE_SCOPE char * MouseTrackingResultToAscii(MouseTrackingResult r, char * buf );
+MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
+
+/* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
+#define TkMacOSXInitNamedDebugSymbol(module, ret, symbol, ...) \
+ static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
+ if (symbol == (void*)(-1L)) { \
+ symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\
+ }
+
#endif
#endif
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 00f02ea..aefde49 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.17 2005/12/08 07:50:14 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.18 2006/01/10 05:37:51 das Exp $
*/
#include "tkInt.h"
@@ -170,12 +170,13 @@ TkpInit(interp)
if (rsrc) {
ReleaseResource(rsrc);
} else {
+#ifndef __LP64__
const struct mach_header *image;
char *data = NULL;
uint32_t size;
int fd = -1;
char fileName[L_tmpnam + 15];
- int i, n;
+ uint32_t i, n;
/* Get resource data from __tk_rsrc section of tk library file */
n = _dyld_image_count();
@@ -216,6 +217,7 @@ TkpInit(interp)
unlink(fileName);
close(fd);
}
+#endif /* __LP64__ */
}
}
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 4f849bc..eaef5f1 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.24 2005/11/27 06:53:13 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.25 2006/01/10 05:37:51 das Exp $
*/
#include "tkMacOSXInt.h"
#include "tkMenubutton.h"
@@ -25,6 +25,12 @@
#include "tkMacOSXDebug.h"
#include <CoreFoundation/CFString.h>
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_MENUS
+#endif
+*/
+
#if !defined(MAC_OS_X_VERSION_10_3) || \
(MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
/* Define constants only available on Mac OS X 10.3 or later */
@@ -1066,6 +1072,14 @@ ReconfigureIndividualMenu(
TkMenuEntry *mePtr;
int parentDisabled = 0;
+#if defined(TK_MAC_DEBUG) && defined(TK_MAC_DEBUG_MENUS)
+ /* Carbon-internal menu debugging (c.f. Technote 2124) */
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, void, DebugPrintMenu, MenuRef menu);
+ if (DebugPrintMenu) {
+ DebugPrintMenu(macMenuHdl);
+ }
+#endif
+
for (mePtr = menuPtr->menuRefPtr->parentEntryPtr; mePtr != NULL;
mePtr = mePtr->nextCascadePtr) {
char *name = (mePtr->namePtr == NULL) ? ""
@@ -1150,10 +1164,6 @@ ReconfigureIndividualMenu(
((MacMenu *) mePtr->childMenuRefPtr
->menuPtr->platformData)->menuHdl;
- if (childMenuHdl == NULL) {
- childMenuHdl = ((MacMenu *) mePtr->childMenuRefPtr
- ->menuPtr->platformData)->menuHdl;
- }
if (childMenuHdl != NULL) {
{
SetMenuItemHierarchicalID(macMenuHdl, base + index,