Created
May 25, 2012 21:24
-
-
Save jacksonfdam/2790681 to your computer and use it in GitHub Desktop.
Debugging Macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// Debug | |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
#define DEBUG_ON // Toggle to DEBUG_OFF to hide all debug code | |
#ifdef DEBUG_ON | |
#define debug(format, ...) CFShow([NSString stringWithFormat:format, ## __VA_ARGS__]); | |
#else | |
#define debug(format, ...) | |
#endif | |
#define debugRect(rect) debug(@"%s x:%.4f, y:%.4f, w:%.4f, h%.4f", #rect, | |
rect.origin.x, rect.origin.y, rect.size.width, rect.size.height) | |
#define debugSize(size) debug(@"%s w:%.4f, h:%.4f", #size, size.width, size.height) | |
#define debugPoint(point) debug(@"%s x:%.4f, y:%.4f", #pt, pt.x, pt.y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment