diff --git a/config.lib b/config.lib index 0259739eb4..2ef67123e6 100644 --- a/config.lib +++ b/config.lib @@ -1380,7 +1380,7 @@ make_compiler_cflags() { flags="$flags -Wnon-virtual-dtor" fi - if [ $cc_version -ge 43 ]; then + if [ $cc_version -ge 43 ] && [ $cc_version -lt 60 ]; then # Use gnu++0x mode so static_assert() is available. # Don't use c++0x, it breaks mingw (with gcc 4.4.0). cxxflags="$cxxflags -std=gnu++0x" @@ -1401,6 +1401,12 @@ make_compiler_cflags() { flags="$flags -Wno-free-nonheap-object" fi + if [ $cc_version -ge 60 ]; then + # -flifetime-dse=2 (default since GCC 6) doesn't play + # well with our custom pool item allocator + cxxflags="$cxxflags -flifetime-dse=1 -std=gnu++14" + fi + if [ "$enable_lto" != "0" ]; then # GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}' has_lto=`$1 -dumpspecs | grep '\%{flto'` diff --git a/src/3rdparty/squirrel/squirrel/sqapi.cpp b/src/3rdparty/squirrel/squirrel/sqapi.cpp index f02fee29f6..0d769bf1f7 100644 --- a/src/3rdparty/squirrel/squirrel/sqapi.cpp +++ b/src/3rdparty/squirrel/squirrel/sqapi.cpp @@ -798,7 +798,8 @@ SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx) switch(type) { case OT_TABLE: if(type(mt) == OT_TABLE) { - if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle"); v->Pop();} + if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, "delagate cycle"); + v->Pop();} else if(type(mt)==OT_NULL) { _table(self)->SetDelegate(NULL); v->Pop(); } else return sq_aux_invalidtype(v,type); diff --git a/src/engine.cpp b/src/engine.cpp index 9f9abcde0e..56fab3e65f 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -85,6 +85,7 @@ Engine::Engine(VehicleType type, EngineID base) this->type = type; this->grf_prop.local_id = base; this->list_position = base; + this->preview_company = INVALID_COMPANY; /* Check if this base engine is within the original engine data range */ if (base >= _engine_counts[type]) { @@ -902,7 +903,7 @@ CommandCost CmdSetVehicleVisibility(TileIndex tile, DoCommandFlag flags, uint32 CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { Engine *e = Engine::GetIfValid(p1); - if (e == NULL || e->preview_company != _current_company) return CMD_ERROR; + if (e == NULL || !(e->flags & ENGINE_EXCLUSIVE_PREVIEW) || e->preview_company != _current_company) return CMD_ERROR; if (flags & DC_EXEC) AcceptEnginePreview(p1, _current_company); diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 624b4d5474..c6fcd0a9e5 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -204,8 +204,8 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val; switch (adjust->type) { - case DSGA_TYPE_DIV: value /= (S)adjust->divmod_val; break; - case DSGA_TYPE_MOD: value %= (U)adjust->divmod_val; break; + case DSGA_TYPE_DIV: value = (S)value / (S)adjust->divmod_val; break; + case DSGA_TYPE_MOD: value = (S)value % (S)adjust->divmod_val; break; case DSGA_TYPE_NONE: break; } diff --git a/src/strings.cpp b/src/strings.cpp index d2ce762b70..8cd071d0ba 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -35,7 +35,9 @@ #include "window_func.h" #include "debug.h" #include "game/game_text.hpp" -#include "network/network_content_gui.h" +#ifdef ENABLE_NETWORK +# include "network/network_content_gui.h" +#endif /* ENABLE_NETWORK */ #include #include "table/strings.h" @@ -1815,7 +1817,9 @@ bool ReadLanguagePack(const LanguageMetadata *lang) SortIndustryTypes(); BuildIndustriesLegend(); SortNetworkLanguages(); +#ifdef ENABLE_NETWORK BuildContentTypeStringList(); +#endif /* ENABLE_NETWORK */ InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window. InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window. InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.