tkMacOSXDebug.h 951 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * tkMacOSXDebug.h --
  3. *
  4. * Declarations of Macintosh specific functions for debugging MacOS events,
  5. * regions, etc...
  6. *
  7. * Copyright 2001-2009, Apple Inc.
  8. * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
  9. *
  10. * See the file "license.terms" for information on usage and redistribution
  11. * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12. */
  13. #ifndef _TKMACDEBUG
  14. #define _TKMACDEBUG
  15. #ifndef _TKMACINT
  16. #include "tkMacOSXInt.h"
  17. #endif
  18. #ifdef TK_MAC_DEBUG
  19. MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
  20. /* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
  21. #define TkMacOSXInitNamedDebugSymbol(module, ret, symbol, ...) \
  22. static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
  23. if (symbol == (void*)(-1L)) { \
  24. symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\
  25. }
  26. #endif /* TK_MAC_DEBUG */
  27. #endif