summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/AppHdr.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-06-22 13:56:12 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-06-22 13:56:12 +0200
commita87b586b593fe0056dac4d990c03d0befebe505a (patch)
treed9fbf887cdc0d1b18dbb752f7310250850691e91 /crawl-ref/source/AppHdr.h
parent81fc2edf2e53296c87dffd49865d99f81620ce43 (diff)
downloadcrawl-ref-a87b586b593fe0056dac4d990c03d0befebe505a.tar.gz
crawl-ref-a87b586b593fe0056dac4d990c03d0befebe505a.zip
Make is_tiles() available on the C++ side.
In webtiles, the same binary can run both, so this function returns whether this particular game is controlled from console or tiles (there may be spectators using either, possibly at the same time). Declared constexpr in other build modes, so if we ever turn on C++11ยน mode, they'll be as effective as #ifdefs. Without it, optimized builds may or may not eliminate code that depends on it, debug builds won't. [1]. While there are niceties like sane initialization of arrays, etc, FreeBSD and MacOS use truly ancient compilers, so C++11 is currently not an option.
Diffstat (limited to 'crawl-ref/source/AppHdr.h')
-rw-r--r--crawl-ref/source/AppHdr.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 66c23cca5a..ac99c747f3 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -83,6 +83,10 @@
#endif
#endif
+#if !defined(__cplusplus) || (__cplusplus < 201103)
+# define constexpr const
+#endif
+
// =========================================================================
// System Defines
// =========================================================================
@@ -381,11 +385,6 @@ inline void UNUSED(const volatile T &)
{
}
-// C++11 has stricter requirements for compile-time checks.
-# if __cplusplus < 201103
-# define constexpr const
-# endif
-
#endif // __cplusplus