News:

Want to praise Simutrans?
Your feedback is important for us ;D.

[r7915] error in player/simplay.cc

Started by captain crunch, October 15, 2016, 10:08:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

captain crunch

I get an error when compiling simutrans with clang 3.5.0 on linux with SDL:

player/simplay.cc:545:22: error: 'waytype_t' is not a class, namespace, or
      scoped enumeration
                                                waytype_t wt = waytype_t...


Removing the namespace selector seems to fix this.

diff --git a/player/simplay.cc b/player/simplay.cc
index 4dcf0b7..7e81267 100644
--- a/player/simplay.cc
+++ b/player/simplay.cc
@@ -542,7 +542,7 @@ void player_t::ai_bankrupt()
obj_t *obj = gr->obj_bei(i);
if(obj->get_owner()==this) {
sint32 costs = 0;
- waytype_t wt = waytype_t::ignore_wt;
+ waytype_t wt = ignore_wt;
switch(obj->get_typ()) {
case obj_t::roadsign:
case obj_t::signal:


Dwachs

Parsley, sage, rosemary, and maggikraut.

DrSuperGood

#2
It appears that I accidently used a C++11 language feature (enum constants are in the scope of the enum type). This was not caught because I program with MSVC2015 which supports C++11. Sorry for any inconvenience this caused.

EDIT:
Commit 7192 introduced a build error for MSVC. This has now been fixed.

Dwachs

Parsley, sage, rosemary, and maggikraut.