Author: cazfi
Date: Sat Feb  7 06:13:30 2015
New Revision: 28013

URL: http://svn.gna.org/viewcvs/freeciv?rev=28013&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:
    branches/S2_6/common/ai.h
    branches/S2_6/common/fc_types.h
    branches/S2_6/common/scriptcore/luascript.h
    branches/S2_6/common/unit.h
    branches/S2_6/gen_headers/freeciv_config.h.in
    branches/S2_6/m4/debug.m4
    branches/S2_6/server/commands.h
    branches/S2_6/server/sanitycheck.h
    branches/S2_6/server/srv_log.h
    branches/S2_6/utility/bitvector.h
    branches/S2_6/utility/log.h
    branches/S2_6/utility/speclist.h
    branches/S2_6/utility/timing.h

Modified: branches/S2_6/common/ai.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/ai.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/common/ai.h   (original)
+++ branches/S2_6/common/ai.h   Sat Feb  7 06:13:30 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: branches/S2_6/common/fc_types.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/fc_types.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/common/fc_types.h     (original)
+++ branches/S2_6/common/fc_types.h     Sat Feb  7 06:13:30 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: branches/S2_6/common/scriptcore/luascript.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/scriptcore/luascript.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/common/scriptcore/luascript.h (original)
+++ branches/S2_6/common/scriptcore/luascript.h Sat Feb  7 06:13:30 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: branches/S2_6/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/unit.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/common/unit.h (original)
+++ branches/S2_6/common/unit.h Sat Feb  7 06:13:30 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: branches/S2_6/gen_headers/freeciv_config.h.in
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/gen_headers/freeciv_config.h.in?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/gen_headers/freeciv_config.h.in       (original)
+++ branches/S2_6/gen_headers/freeciv_config.h.in       Sat Feb  7 06:13:30 2015
@@ -44,4 +44,7 @@
 /* jansson network protocol in use */
 #undef FREECIV_JSON_CONNECTION
 
+/* Extra debugging support */
+#undef FREECIV_DEBUG
+
 #endif /* FC__FREECIV_CONFIG_H */

Modified: branches/S2_6/m4/debug.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/m4/debug.m4?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/m4/debug.m4   (original)
+++ branches/S2_6/m4/debug.m4   Sat Feb  7 06:13:30 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: branches/S2_6/server/commands.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/commands.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/server/commands.h     (original)
+++ branches/S2_6/server/commands.h     Sat Feb  7 06:13:30 2015
@@ -67,7 +67,7 @@
   CMD_NORMAL,
   CMD_HARD,
   CMD_CHEATING,
-#ifdef DEBUG
+#ifdef FREECIV_DEBUG
   CMD_EXPERIMENTAL,
 #endif
   CMD_CMDLEVEL,

Modified: branches/S2_6/server/sanitycheck.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/sanitycheck.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/server/sanitycheck.h  (original)
+++ branches/S2_6/server/sanitycheck.h  Sat Feb  7 06:13:30 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: branches/S2_6/server/srv_log.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/srv_log.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/server/srv_log.h      (original)
+++ branches/S2_6/server/srv_log.h      Sat Feb  7 06:13:30 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: branches/S2_6/utility/bitvector.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/bitvector.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/utility/bitvector.h   (original)
+++ branches/S2_6/utility/bitvector.h   Sat Feb  7 06:13:30 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: branches/S2_6/utility/log.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/log.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/utility/log.h (original)
+++ branches/S2_6/utility/log.h Sat Feb  7 06:13:30 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: branches/S2_6/utility/speclist.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/speclist.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/utility/speclist.h    (original)
+++ branches/S2_6/utility/speclist.h    Sat Feb  7 06:13:30 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: branches/S2_6/utility/timing.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/timing.h?rev=28013&r1=28012&r2=28013&view=diff
==============================================================================
--- branches/S2_6/utility/timing.h      (original)
+++ branches/S2_6/utility/timing.h      Sat Feb  7 06:13:30 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