summaryrefslogtreecommitdiff
path: root/src/driver.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-07-14 20:21:02 +0000
committertruelight <truelight@openttd.org>2007-07-14 20:21:02 +0000
commita2a3b7da24faf464a70bb3efcfb44d8491105117 (patch)
tree4c8b57b8e23fe39ea37d32a534df3efce2864753 /src/driver.h
parent452d20487eb728b0731e7f763d67bcb854aeac1a (diff)
downloadopenttd-a2a3b7da24faf464a70bb3efcfb44d8491105117.tar.xz
(svn r10561) -Fix: don't give 'unused variable' warnings when disabling asserts
Diffstat (limited to 'src/driver.h')
-rw-r--r--src/driver.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/driver.h b/src/driver.h
index a57e62459..fa16cd24c 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -79,7 +79,11 @@ protected:
strecpy(buf, GetDriverTypeName(type), lastof(buf));
strecpy(buf + 5, name, lastof(buf));
- std::pair<Drivers::iterator, bool> P = GetDrivers().insert(Drivers::value_type(buf, this));
+#if !defined(NDEBUG)
+ /* NDEBUG disables asserts and gives a warning: unused variable 'P' */
+ std::pair<Drivers::iterator, bool> P =
+#endif /* !NDEBUG */
+ GetDrivers().insert(Drivers::value_type(buf, this));
assert(P.second);
}