From cc607d87ed119887d845f3efd3f2e5357aa6fda6 Mon Sep 17 00:00:00 2001 From: das Date: Wed, 6 Jun 2007 21:23:56 +0000 Subject: * macosx/tkMacOSXInt.h: use native debug message API when available. --- ChangeLog | 2 ++ macosx/tkMacOSXInt.h | 20 ++++++++++++++++++-- 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 + * 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 #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 */ -- cgit v0.12