[vte] Revert "build: Fix the build with --disable-debug"
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] Revert "build: Fix the build with --disable-debug"
- Date: Tue, 15 Dec 2015 19:39:32 +0000 (UTC)
commit 09ffddeb138c26b99de919c8c796ae2c2bdcb666
Author: Christian Persch <chpe gnome org>
Date: Tue Dec 15 20:38:41 2015 +0100
Revert "build: Fix the build with --disable-debug"
This reverts commit 413c9920a004c8f3f0907ddcfb7ca6bd004c21d7.
src/vtetypes.cc | 20 ++------------------
src/vtetypes.hh | 14 ++++++++++----
2 files changed, 12 insertions(+), 22 deletions(-)
---
diff --git a/src/vtetypes.cc b/src/vtetypes.cc
index 2e71183..3d88910 100644
--- a/src/vtetypes.cc
+++ b/src/vtetypes.cc
@@ -131,24 +131,17 @@ 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]";
@@ -156,35 +149,26 @@ 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 cba4f3e..0096e33 100644
--- a/src/vtetypes.hh
+++ b/src/vtetypes.hh
@@ -21,6 +21,12 @@
#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 {
@@ -47,7 +53,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); }
- char const* to_string() const;
+ IFDEF_DEBUG(char const* to_string() const);
private:
row_t m_row;
@@ -84,7 +90,7 @@ namespace grid {
inline bool contains(row_t row, column_t column) { return contains(coords(row, column)); }
- char const* to_string() const;
+ IFDEF_DEBUG(char const* to_string() const);
private:
coords m_start;
@@ -109,7 +115,7 @@ namespace view {
void swap(coords &rhs) { coords tmp = rhs; rhs = *this; *this = tmp; }
- char const* to_string() const;
+ IFDEF_DEBUG(char const* to_string() const);
public:
coord_t x;
@@ -141,7 +147,7 @@ namespace color {
return red == rhs.red && green == rhs.green && blue == rhs.blue;
}
- char const* to_string() const;
+ IFDEF_DEBUG(char const* to_string() const);
};
} /* namespace color */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]