Thu, 03 Mar 2011 08:15:09 +0000
add single-string logging functions to work around gcc warning
src/utils.h | file | annotate | diff | revisions |
1.1 --- a/src/utils.h Wed Mar 02 07:16:32 2011 +0000 1.2 +++ b/src/utils.h Thu Mar 03 08:15:09 2011 +0000 1.3 @@ -6,11 +6,15 @@ 1.4 #ifndef NDEBUG 1.5 /// Log a message to stderr 1.6 # define LOG(x, ...) do { fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); } while (0) 1.7 +# define LOGS(x) do { fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); } while (0) 1.8 /// Log a message to stderr if 'cond' is true 1.9 # define LOG_IF(cond, x, ...) do { if (cond) fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); } while (0) 1.10 +# define LOG_IFS(cond, x) do { if (cond) fprintf(stderr, "%s:%d:%s(): " x "\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); } while (0) 1.11 #else 1.12 #define LOG(x, ...) 1.13 +#define LOGS(x) 1.14 #define LOG_IF(cond, x, ...) 1.15 +#define LOG_IFS(cond, x) 1.16 #endif 1.17 1.18 /// Get the number of elements in an array