The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: captain crunch on October 15, 2016, 10:08:07 AM

Title: [r7915] error in player/simplay.cc
Post by: captain crunch on October 15, 2016, 10:08:07 AM
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:

Title: Re: [r7915] error in player/simplay.cc
Post by: Dwachs on October 15, 2016, 10:36:19 AM
already fixed in 7916
Title: Re: [r7915] error in player/simplay.cc
Post by: DrSuperGood on October 15, 2016, 03:50:18 PM
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.
Title: Re: [r7915] error in player/simplay.cc
Post by: Dwachs on October 16, 2016, 06:44:11 AM
thank you