Author: cazfi
Date: Sat Feb  7 06:13:22 2015
New Revision: 28012

URL: http://svn.gna.org/viewcvs/freeciv?rev=28012&view=rev
Log:
Add FREECIV_DEBUG macro as public replacement of DEBUG. Keep latter defined in 
private
fc_config.h when ever FREECIV_DEBUG is, for those parts of the code that still 
rely on it.
All headers use FREECIV_DEBUG instead of DEBUG.

See bug #23069

Modified:
    trunk/common/ai.h
    trunk/common/fc_types.h
    trunk/common/scriptcore/luascript.h
    trunk/common/unit.h
    trunk/gen_headers/freeciv_config.h.in
    trunk/m4/debug.m4
    trunk/server/commands.h
    trunk/server/sanitycheck.h
    trunk/server/srv_log.h
    trunk/utility/bitvector.h
    trunk/utility/log.h
    trunk/utility/speclist.h
    trunk/utility/timing.h

Modified: trunk/common/ai.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/ai.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/common/ai.h   (original)
+++ trunk/common/ai.h   Sat Feb  7 06:13:22 2015
@@ -25,9 +25,9 @@
 #define FC_AI_MOD_CAPSTR "+Freeciv-ai-module-2014.Oct.09"
 
 /* Timers for all AI activities. Define it to get statistics about the AI. */
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #  undef DEBUG_AITIMERS
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 struct Treaty;
 struct player;

Modified: trunk/common/fc_types.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/fc_types.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/common/fc_types.h     (original)
+++ trunk/common/fc_types.h     Sat Feb  7 06:13:22 2015
@@ -239,10 +239,10 @@
 #define SPECENUM_VALUE6 AI_LEVEL_CHEATING
 #define SPECENUM_VALUE6NAME N_("Cheating")
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define SPECENUM_VALUE7 AI_LEVEL_EXPERIMENTAL
 #define SPECENUM_VALUE7NAME N_("Experimental")
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 #define SPECENUM_COUNT AI_LEVEL_COUNT
 #include "specenum_gen.h"

Modified: trunk/common/scriptcore/luascript.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/luascript.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/common/scriptcore/luascript.h (original)
+++ trunk/common/scriptcore/luascript.h Sat Feb  7 06:13:22 2015
@@ -98,7 +98,7 @@
 #define LUASCRIPT_ASSERT_CAT(str1, str2) str1 ## str2
 
 /* Script assertion (for debugging only) */
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define LUASCRIPT_ASSERT(L, check, ...)                                      \
   if (!(check)) {                                                            \
     luascript_error(L, "in %s() [%s::%d]: the assertion '%s' failed.",       \

Modified: trunk/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/common/unit.h (original)
+++ trunk/common/unit.h Sat Feb  7 06:13:22 2015
@@ -209,7 +209,7 @@
   };
 };
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define CHECK_UNIT(punit)                                                   \
   (fc_assert(punit != NULL),                                                \
    fc_assert(unit_type(punit) != NULL),                                     \
@@ -217,9 +217,9 @@
    fc_assert(player_by_number(player_index(unit_owner(punit)))              \
              == unit_owner(punit)),                                         \
    fc_assert(game_unit_by_number(punit->id) != NULL))
-#else
+#else  /* FREECIV_DEBUG */
 #define CHECK_UNIT(punit) /* Do nothing */
-#endif
+#endif /* FREECIV_DEBUG */
 
 void setup_real_activities_array(void);
 

Modified: trunk/gen_headers/freeciv_config.h.in
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/gen_headers/freeciv_config.h.in?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/gen_headers/freeciv_config.h.in       (original)
+++ trunk/gen_headers/freeciv_config.h.in       Sat Feb  7 06:13:22 2015
@@ -47,4 +47,7 @@
 /* jansson network protocol in use */
 #undef FREECIV_JSON_CONNECTION
 
+/* Extra debugging support */
+#undef FREECIV_DEBUG
+
 #endif /* FC__FREECIV_CONFIG_H */

Modified: trunk/m4/debug.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/m4/debug.m4?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/m4/debug.m4   (original)
+++ trunk/m4/debug.m4   Sat Feb  7 06:13:22 2015
@@ -36,7 +36,8 @@
 dnl ==========================================================================
 dnl debug level >= yes
 if test "x$enable_debug" = "xyes" -o "x$enable_debug" = "xchecks"; then
-  AC_DEFINE([DEBUG], [1], [Extra debugging support])
+  AC_DEFINE([FREECIV_DEBUG], [1], [Extra debugging support])
+  AC_DEFINE([DEBUG], [1], [Extra debugging support, backward compatibility 
macro])
   AC_DEFINE([LUA_USE_APICHECK], [1], [Lua Api checks])
 
   FC_C_FLAGS([-Werror -Wmissing-prototypes -Wmissing-declarations \

Modified: trunk/server/commands.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/commands.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/server/commands.h     (original)
+++ trunk/server/commands.h     Sat Feb  7 06:13:22 2015
@@ -67,7 +67,7 @@
   CMD_NORMAL,
   CMD_HARD,
   CMD_CHEATING,
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
   CMD_EXPERIMENTAL,
 #endif
   CMD_CMDLEVEL,

Modified: trunk/server/sanitycheck.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/sanitycheck.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/server/sanitycheck.h  (original)
+++ trunk/server/sanitycheck.h  Sat Feb  7 06:13:22 2015
@@ -16,7 +16,7 @@
 #include "fc_types.h"
 
 #if ((IS_BETA_VERSION || IS_DEVEL_VERSION) && !defined NDEBUG) \
-  || defined DEBUG
+  || defined(FREECIV_DEBUG)
 #  define SANITY_CHECKING
 #endif
 

Modified: trunk/server/srv_log.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/srv_log.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/server/srv_log.h      (original)
+++ trunk/server/srv_log.h      Sat Feb  7 06:13:22 2015
@@ -118,12 +118,12 @@
 void timing_log_real(enum ai_timer timer, enum ai_timer_activity activity);
 void timing_results_real(void);
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define TIMING_LOG(timer, activity) timing_log_real(timer, activity)
 #define TIMING_RESULTS() timing_results_real()
-#else  /* DEBUG */
+#else  /* FREECIV_DEBUG */
 #define TIMING_LOG(timer, activity)
 #define TIMING_RESULTS()
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 #endif  /* FC__SRV_LOG_H */

Modified: trunk/utility/bitvector.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/bitvector.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/utility/bitvector.h   (original)
+++ trunk/utility/bitvector.h   Sat Feb  7 06:13:22 2015
@@ -61,7 +61,7 @@
 #define _BV_BYTES(bits)        ((((bits) - 1) / 8) + 1)
 #define _BV_BYTE_INDEX(bits)   ((bits) / 8)
 #define _BV_BITMASK(bit)       (1u << ((bit) & 0x7))
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #  define _BV_ASSERT(bv, bit)  fc_assert((bit) >= 0                         \
                                          && (bit) < (signed int) 
sizeof((bv).vec) * 8)
 #else

Modified: trunk/utility/log.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/log.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/utility/log.h (original)
+++ trunk/utility/log.h Sat Feb  7 06:13:22 2015
@@ -64,7 +64,7 @@
 log_prefix_fn log_set_prefix(log_prefix_fn prefix);
 void log_set_level(enum log_level level);
 enum log_level log_get_level(void);
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 bool log_do_output_for_level_at_location(enum log_level level,
                                          const char *file, int line);
 #endif
@@ -77,12 +77,12 @@
             const char *message, ...)
             fc__attribute((__format__ (__printf__, 6, 7)));
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define log_do_output_for_level(level) \
   log_do_output_for_level_at_location(level, __FILE__, __FC_LINE__)
 #else
 #define log_do_output_for_level(level) (log_get_level() >= level)
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 
 /* The log macros */
@@ -101,12 +101,12 @@
   log_base(LOG_NORMAL, message, ## __VA_ARGS__)
 #define log_verbose(message, ...)                                           \
   log_base(LOG_VERBOSE, message, ## __VA_ARGS__)
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #  define log_debug(message, ...)                                           \
   log_base(LOG_DEBUG, message, ## __VA_ARGS__)
 #else
 #  define log_debug(message, ...) /* Do nothing. */
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 /* Used by game debug command */
 #define log_test log_normal

Modified: trunk/utility/speclist.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/speclist.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/utility/speclist.h    (original)
+++ trunk/utility/speclist.h    Sat Feb  7 06:13:22 2015
@@ -555,12 +555,12 @@
 #ifndef FC__SPECLIST_H  /* Defines this only once, no multiple inclusions. */
 #define FC__SPECLIST_H
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #  define TYPED_LIST_CHECK(ARG_list)                                       \
   fc_assert_action(NULL != ARG_list, break)
 #else
 #  define TYPED_LIST_CHECK(ARG_list) /* Nothing. */
-#endif /* DEBUG */
+#endif /* FREECIV_DEBUG */
 
 /* Speclist data iterator.
  * 

Modified: trunk/utility/timing.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/timing.h?rev=28012&r1=28011&r2=28012&view=diff
==============================================================================
--- trunk/utility/timing.h      (original)
+++ trunk/utility/timing.h      Sat Feb  7 06:13:22 2015
@@ -32,7 +32,7 @@
 /* Timing logging happens so often only in debug builds that it makes
    sense to have macro defined for it once here and to have all the
    checks against that single macro instead of two separate. */
-#if defined(LOG_TIMERS) && defined(DEBUG)
+#if defined(LOG_TIMERS) && defined(FREECIV_DEBUG)
 #define DEBUG_TIMERS
 #endif
 
@@ -53,7 +53,7 @@
  * Also note TIMER_DEBUG below.
  */
 
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
 #define TIMER_DEBUG TIMER_ACTIVE
 #else
 #define TIMER_DEBUG TIMER_IGNORE


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to