summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2007-06-06 21:23:37 (GMT)
committerdas <das>2007-06-06 21:23:37 (GMT)
commita700737d94005b30448cf6028feee89c787ed748 (patch)
treec26f152a57f35dcd9d52e433dee5fd694bcab800 /macosx
parentadc0bc4faa9cf2596b856fd534befb42fab5d366 (diff)
downloadtk-a700737d94005b30448cf6028feee89c787ed748.zip
tk-a700737d94005b30448cf6028feee89c787ed748.tar.gz
tk-a700737d94005b30448cf6028feee89c787ed748.tar.bz2
* macosx/tkMacOSXInt.h: use native debug message API when available.
* macosx/Wish-Debug.xcconfig:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/Wish-Debug.xcconfig4
-rw-r--r--macosx/tkMacOSXInt.h20
2 files changed, 20 insertions, 4 deletions
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 */