summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--macosx/Wish-Debug.xcconfig4
-rw-r--r--macosx/tkMacOSXInt.h20
3 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 302342f..6705cb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+ * macosx/tkMacOSXInt.h: use native debug message API when available.
+ * macosx/Wish-Debug.xcconfig:
+
* macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): enable
processing of mousewheel events in background windows.
diff --git a/macosx/Wish-Debug.xcconfig b/macosx/Wish-Debug.xcconfig
index 19c1f71..e2a31cb 100644
--- a/macosx/Wish-Debug.xcconfig
+++ b/macosx/Wish-Debug.xcconfig
@@ -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: Wish-Debug.xcconfig,v 1.2 2007/04/23 21:24:32 das Exp $
+// RCS: @(#) $Id: Wish-Debug.xcconfig,v 1.3 2007/06/06 21:23:37 das Exp $
//
#include "Wish-Common.xcconfig"
@@ -17,6 +17,6 @@
DEBUG_INFORMATION_FORMAT = dwarf
DEPLOYMENT_POSTPROCESSING = NO
GCC_OPTIMIZATION_LEVEL = 0
-GCC_PREPROCESSOR_DEFINITIONS = DEBUG_ASSERT_PRODUCTION_CODE=0 $(TCL_DEFS) $(TK_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
+GCC_PREPROCESSOR_DEFINITIONS = DEBUGLEVEL=4 $(TCL_DEFS) $(TK_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
CONFIGURE_ARGS = --enable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
MAKE_TARGET = develop
diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h
index 2b7da1b..119f61d 100644
--- a/macosx/tkMacOSXInt.h
+++ b/macosx/tkMacOSXInt.h
@@ -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: tkMacOSXInt.h,v 1.25 2007/06/06 09:55:52 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInt.h,v 1.26 2007/06/06 21:23:37 das Exp $
*/
#ifndef _TKMACINT
@@ -20,6 +20,8 @@
#include "tkInt.h"
#endif
+#define kComponentSignatureString "TkMacOSX"
+#define COMPONENT_SIGNATURE 'Tk '
#define TextStyle MacTextStyle
#include <Carbon/Carbon.h>
#undef TextStyle
@@ -280,13 +282,26 @@ MODULE_SCOPE int TkMacOSXCompareColors(unsigned long c1, unsigned long c2);
__LINE__, __func__, ##__VA_ARGS__); \
} while (0)
/*
+ * Macro to do debug API failure message output.
+ */
+#if !defined(DEBUGLEVEL) || !DEBUGLEVEL
+#define TkMacOSXDbgOSErr(f, err) do { \
+ TkMacOSXDbgMsg("%s failed: %ld", #f, err); \
+ } while (0)
+#else
+#define TkMacOSXDbgOSErr(f, err) do { \
+ DEBUG_ASSERT_MESSAGE(kComponentSignatureString, #f " failed:", \
+ __func__, 0, strrchr(__FILE__, '/')+1, __LINE__, err); \
+ } while (0)
+#endif
+/*
* Macro to do very common check for noErr return from given API and output
* debug message in case of failure.
*/
#define ChkErr(f, ...) ({ \
OSStatus err = f(__VA_ARGS__); \
if (err != noErr) { \
- TkMacOSXDbgMsg("%s failed: %ld", #f, err); \
+ TkMacOSXDbgOSErr(f, err); \
} \
err;})
/*
@@ -299,6 +314,7 @@ MODULE_SCOPE int TkMacOSXCompareColors(unsigned long c1, unsigned long c2);
} while(0)
#else /* TK_MAC_DEBUG */
#define TkMacOSXDbgMsg(m, ...)
+#define TkMacOSXDbgOSErr(f, err)
#define ChkErr(f, ...) ({f(__VA_ARGS__);})
#define TkMacOSXCheckTmpRgnEmpty(r)
#endif /* TK_MAC_DEBUG */