summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-04-01 23:57:49 +0100
committerGitHub <noreply@github.com>2021-04-01 23:57:49 +0100
commitdd798d688b7e9ea6c7d4d01aea976dde5ec75f60 (patch)
tree35dbd6e5a3c3288d098cd961315bc57ae79ce524 /src/widget.cpp
parent2a9825b8dec9d5bb3f43e36fcaae735f505e81de (diff)
downloadopenttd-dd798d688b7e9ea6c7d4d01aea976dde5ec75f60.tar.xz
Fix #8919: Release builds with asserts enabled (#8925)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index b06562108..9de848a63 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -1156,7 +1156,7 @@ void NWidgetHorizontal::SetupSmallestSize(Window *w, bool init_array)
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
}
/* 1b. Make the container higher if needed to accommodate all children nicely. */
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height.
#endif
uint cur_height = this->smallest_y;
@@ -1323,7 +1323,7 @@ void NWidgetVertical::SetupSmallestSize(Window *w, bool init_array)
this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right);
}
/* 1b. Make the container wider if needed to accommodate all children nicely. */
-#ifndef NDEBUG
+#ifdef WITH_ASSERT
uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height.
#endif
uint cur_width = this->smallest_x;