diff options
author | David <dbphillipsnz@gmail.com> | 2014-06-04 19:54:12 +1200 |
---|---|---|
committer | David <dbphillipsnz@gmail.com> | 2014-06-06 20:31:40 +1200 |
commit | 38f928b2f33ec527490899e580e5ee1327a327e9 (patch) | |
tree | 8e7d50f2d5a50e20e8f384241afe782ea94653a3 /common.h | |
parent | 4634e137f7c1ab4a06ae6b6e808510159be55000 (diff) | |
download | paramano-38f928b2f33ec527490899e580e5ee1327a327e9.tar.xz |
Moved away from manual setting of sudo-ness
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -25,4 +25,24 @@ int get_int_value_from_file(const char* filename); int get_int(const char* string); bool file_has_line(const char *filename, const char *line); +#include <stdio.h> +// <ew> Stringification of line number +#define STRING2(x) #x +#define STRING(x) STRING2(x) +#define STR_LINE STRING(__LINE__) +// </ew> + + +#ifdef DEBUG +/* + Make debug macros into empty space if debug mode's not enabled. + Otherwise, make debug macro calls into appropriate printf()s +*/ + #define debug(...) printf("DEBUG: "__FILE__":"STR_LINE" --- "__VA_ARGS__) +#else + #define debug(...); +#endif + +#define info(...) printf("INFO: "__FILE__":"STR_LINE" --- "__VA_ARGS__) + #endif |