diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-30 01:17:30 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-30 01:17:30 +0000 |
commit | 96a64a6214f7c68b0aa6b94836e77cdf6984d728 (patch) | |
tree | 285c4414e8f6e1692b698eb4b833bd796f74826d /crawl-ref/source/view.cc | |
parent | c7d7127e04437181a909dc4c7bbbc5e408e7f798 (diff) | |
download | crawl-ref-96a64a6214f7c68b0aa6b94836e77cdf6984d728.tar.gz crawl-ref-96a64a6214f7c68b0aa6b94836e77cdf6984d728.zip |
When using gcc (the Linux/UNIX compiler) static class members must be
initialized outside of the class declaration or they won't by defined in
any of the object files, leading to "undefined reference" errors when
linking.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5336 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 801be16f2a..674b576ec8 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -91,6 +91,13 @@ #define MC_ITEM 0x01 #define MC_MONS 0x02 +// Static class members must be initialized outside of the class declaration, +// or gcc won't define them in view.o and we'll get a linking error. +const int monster_los::LSIZE = _monster_los_LSIZE; +const int monster_los::L_VISIBLE = 1; +const int monster_los::L_UNKNOWN = 0; +const int monster_los::L_BLOCKED = -1; + static FixedVector<feature_def, NUM_FEATURES> Feature; crawl_view_geometry crawl_view; |