summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--macosx/tkMacOSXInt.h20
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f72e989..4f5af7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+ * macosx/tkMacOSXInt.h: use native debug message API when available.
+
* macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): enable
processing of mousewheel events in background windows.
diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h
index 30cb431..1cadc52 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.3.2.18 2007/06/06 09:56:54 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInt.h,v 1.3.2.19 2007/06/06 21:23:57 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
@@ -269,13 +271,26 @@ typedef struct TkMacOSXDrawingContext {
__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;})
/*
@@ -288,6 +303,7 @@ typedef struct TkMacOSXDrawingContext {
} 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 */