Created
May 22, 2009 17:53
-
-
Save jeremyBanks/116267 to your computer and use it in GitHub Desktop.
[2010-01] some defines to print line numbers for debugging in c
This file contains hidden or 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
// Won't work if you don't use {]s everywhere. | |
#define PRINT_ABBREVIATED_FILE_AND_LINE() fprintf(stderr,"[%.3s:%i]", __FILE__ + 2, __LINE__) && fflush(stderr) | |
#define if PRINT_ABBREVIATED_FILE_AND_LINE(); if | |
#define for PRINT_ABBREVIATED_FILE_AND_LINE(); for | |
#define while PRINT_ABBREVIATED_FILE_AND_LINE(); while | |
#define return PRINT_ABBREVIATED_FILE_AND_LINE(); return | |
#define free PRINT_ABBREVIATED_FILE_AND_LINE(); free |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment