diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/log.h freeciv/common/log.h --- FreecivCVS/common/log.h Tue Aug 8 09:09:22 2000 +++ freeciv/common/log.h Sat Sep 2 08:14:22 2000 @@ -17,6 +17,7 @@ #include "attribute.h" +#define LOG_NEVER (-1) /* may be used to disable log messages */ #define LOG_FATAL 0 #define LOG_ERROR 1 /* non-fatal errors */ #define LOG_NORMAL 2 @@ -76,10 +77,10 @@ && line <= logdebug_thisfile.max))); } /* Including log.h without calling freelog() can generate a - warning that logdebug_check is never used; can use this to - suppress that warning: + warning that either freelog or logdebug_check is never used; + use this to suppress that warning: */ -#define logdebug_suppress_warning logdebug_check(__FILE__, __LINE__) +#define logdebug_suppress_warning freelog(LOG_NEVER, " ") #else #define logdebug_suppress_warning #endif @@ -90,13 +91,14 @@ #ifdef __GNUC__ #ifdef DEBUG #define freelog(level, args...) do { \ - if ((level) != LOG_DEBUG || logdebug_check(__FILE__, __LINE__)) { \ + if ((level) > LOG_NEVER && \ + ((level) < LOG_DEBUG || logdebug_check(__FILE__, __LINE__))) { \ real_freelog((level), ##args); \ } \ } while(0) #else #define freelog(level, args...) do { \ - if ((level) != LOG_DEBUG) { \ + if ((level) > LOG_NEVER && (level) < LOG_DEBUG) { \ real_freelog((level), ##args); } \ } while(0) #endif /* DEBUG */ @@ -106,9 +108,10 @@ { int log_this; #ifdef DEBUG - log_this = (level != LOG_DEBUG || logdebug_check(__FILE__, __LINE__)); + log_this = (level > LOG_NEVER && + (level < LOG_DEBUG || logdebug_check(__FILE__, __LINE__))); #else - log_this = (level != LOG_DEBUG); + log_this = (level > LOG_NEVER && level < LOG_DEBUG); #endif if (log_this) { va_list args;