[vte] build: Fix the build with --disable-debug



commit 413c9920a004c8f3f0907ddcfb7ca6bd004c21d7
Author: Christian Persch <chpe gnome org>
Date:   Thu Dec 10 21:08:45 2015 +0100

    build: Fix the build with --disable-debug
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759314

 src/vtetypes.cc |   20 ++++++++++++++++++--
 src/vtetypes.hh |   14 ++++----------
 2 files changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/src/vtetypes.cc b/src/vtetypes.cc
index 3d88910..2e71183 100644
--- a/src/vtetypes.cc
+++ b/src/vtetypes.cc
@@ -131,17 +131,24 @@ debug_get_buf(void)
         return buf + offset * DEBUG_STRING_SIZE;
 }
 
+#endif /* VTE_DEBUG */
+
 char const*
 vte::grid::coords::to_string() const
 {
+#ifdef VTE_DEBUG
         char *buf = debug_get_buf();
         g_snprintf(buf, DEBUG_STRING_SIZE, "grid[%ld,%ld]", row(), column());
         return buf;
+#else
+        return 0;
+#endif
 }
 
 char const*
 vte::grid::span::to_string() const
 {
+#ifdef VTE_DEBUG
         if (empty())
                 return "grid[empty]";
 
@@ -149,26 +156,35 @@ vte::grid::span::to_string() const
         g_snprintf(buf, DEBUG_STRING_SIZE, "grid[%ld,%ld .. %ld,%ld]",
                    start_row(), start_column(), end_row(), end_column());
         return buf;
+#else
+        return 0;
+#endif
 }
 
 char const*
 vte::view::coords::to_string() const
 {
+#ifdef VTE_DEBUG
         char *buf = debug_get_buf();
         g_snprintf(buf, DEBUG_STRING_SIZE, "view[%ld,%ld]", x, y);
         return buf;
+#else
+        return 0;
+#endif
 }
 
 char const*
 vte::color::rgb::to_string() const
 {
+#ifdef VTE_DEBUG
         char *buf = debug_get_buf();
         g_snprintf(buf, DEBUG_STRING_SIZE, "rgb(%04x,%04x,%04x)", red, green, blue);
         return buf;
+#else
+        return 0;
+#endif
 }
 
-#endif /* VTE_DEBUG */
-
 #ifdef MAIN
 
 #include <glib.h>
diff --git a/src/vtetypes.hh b/src/vtetypes.hh
index 4acc14d..a0e6299 100644
--- a/src/vtetypes.hh
+++ b/src/vtetypes.hh
@@ -21,12 +21,6 @@
 #include <gdk/gdk.h>
 #include <errno.h>
 
-#ifdef VTE_DEBUG
-#define IFDEF_DEBUG(str) str
-#else
-#define IFDEF_DEBUG(str)
-#endif
-
 namespace vte {
 
 namespace grid {
@@ -53,7 +47,7 @@ namespace grid {
                 inline bool operator >  (coords const& rhs) const { return m_row > rhs.m_row || (m_row == 
rhs.m_row && m_column >  rhs.m_column); }
                 inline bool operator >= (coords const& rhs) const { return m_row > rhs.m_row || (m_row == 
rhs.m_row && m_column >= rhs.m_column); }
 
-                IFDEF_DEBUG(char const* to_string() const);
+                char const* to_string() const;
 
         private:
                 row_t m_row;
@@ -90,7 +84,7 @@ namespace grid {
 
                 inline bool contains(row_t row, column_t column) { return contains(coords(row, column)); }
 
-                IFDEF_DEBUG(char const* to_string() const);
+                char const* to_string() const;
 
         private:
                 coords m_start;
@@ -115,7 +109,7 @@ namespace view {
 
                 void swap(coords &rhs) { coords tmp = rhs; rhs = *this; *this = tmp; }
 
-                IFDEF_DEBUG(char const* to_string() const);
+                char const* to_string() const;
 
         public:
                 coord_t x;
@@ -147,7 +141,7 @@ namespace color {
                         return red == rhs.red && green == rhs.green && blue == rhs.blue;
                 }
 
-                IFDEF_DEBUG(char const* to_string() const);
+                char const* to_string() const;
         };
 
 } /* namespace color */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]