summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-10-18 20:26:29 +0000
committerfrosch <frosch@openttd.org>2009-10-18 20:26:29 +0000
commitb8f8c60839ac0451ae83333fd2df9b87a1219534 (patch)
treec16983ed493cd0c6047ba3a7f3d5df1878461058 /src/industry_gui.cpp
parentfea06c575532d1070dc67e49453872601f97f84a (diff)
downloadopenttd-b8f8c60839ac0451ae83333fd2df9b87a1219534.tar.xz
(svn r17810) -Codechange/Fix: Add assert_tcompile() and use it.
OTTD's traditional assert_compile() does not work inside templates for gcc compilers, static_assert() does though. The new assert_tcompile() resolves into static_assert() if present, or into a runtime assert() else.
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 88fbe93c6..5c9064f96 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -85,7 +85,7 @@ static void GetCargoSuffix(uint cargo, CargoSuffixType cst, const Industry *ind,
template <typename TC, typename TS>
static inline void GetAllCargoSuffixes(uint cb_offset, CargoSuffixType cst, const Industry *ind, IndustryType ind_type, const IndustrySpec *indspec, const TC &cargos, TS &suffixes)
{
- assert_compile(lengthof(cargos) <= lengthof(suffixes));
+ assert_tcompile(lengthof(cargos) <= lengthof(suffixes));
for (uint j = 0; j < lengthof(cargos); j++) {
if (cargos[j] != CT_INVALID) {
GetCargoSuffix(cb_offset + j, cst, ind, ind_type, indspec, suffixes[j], lastof(suffixes[j]));