diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua index 5a2f3b0a4b..17a15cec0e 100644 --- a/build/premake/extern_libs5.lua +++ b/build/premake/extern_libs5.lua @@ -560,10 +560,6 @@ extern_lib_defs = { pkgconfig.add_links("mozjs-45") end else - filter { "Debug", "action:vs2013" } - links { "mozjs45-ps-debug-vc120" } - filter { "Release", "action:vs2013" } - links { "mozjs45-ps-release-vc120" } filter { "Debug", "action:vs2015" } links { "mozjs45-ps-debug-vc140" } filter { "Release", "action:vs2015" } diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua index 2cf15be49d..5a7adf5c82 100644 --- a/build/premake/premake5.lua +++ b/build/premake/premake5.lua @@ -381,8 +381,6 @@ function project_create(project_name, target_type) language "C++" kind(target_type) - filter "action:vs2013" - toolset "v120_xp" filter "action:vs2015" toolset "v140_xp" filter {} @@ -854,7 +852,7 @@ function setup_all_libs () end -- runtime-library-specific - if _ACTION == "vs2013" or _ACTION == "vs2015" then + if _ACTION == "vs2015" then table.insert(source_dirs, "lib/sysdep/rtl/msc"); else table.insert(source_dirs, "lib/sysdep/rtl/gcc"); diff --git a/build/workspaces/update-workspaces.bat b/build/workspaces/update-workspaces.bat index 1ec6435141..81c43a443e 100644 --- a/build/workspaces/update-workspaces.bat +++ b/build/workspaces/update-workspaces.bat @@ -2,6 +2,5 @@ rem ** Create Visual Studio Workspaces on Windows ** cd ..\premake -if not exist ..\workspaces\vc2013\SKIP_PREMAKE_HERE premake5\bin\release\premake5 --outpath="../workspaces/vc2013" --use-shared-glooxwrapper %* vs2013 if not exist ..\workspaces\vc2015\SKIP_PREMAKE_HERE premake5\bin\release\premake5 --outpath="../workspaces/vc2015" --use-shared-glooxwrapper %* vs2015 cd ..\workspaces diff --git a/source/lobby/glooxwrapper/glooxwrapper.h b/source/lobby/glooxwrapper/glooxwrapper.h index caca1be3b7..ba2b255115 100644 --- a/source/lobby/glooxwrapper/glooxwrapper.h +++ b/source/lobby/glooxwrapper/glooxwrapper.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -29,9 +29,9 @@ different compiler versions (or the same version with different build flags): the STL types have different layouts, and new/delete can use different heaps. We want to let people build the game on Windows with any compiler version -(VC2008, 2010, 2012, 2013, and debug vs release), without requiring them to -rebuild the gloox library themselves. And we don't want to provide ~8 different -prebuilt versions of the library. +(any supported Visual Studio version, and debug vs release), without requiring +them to rebuild the gloox library themselves. And we don't want to provide ~8 +different prebuilt versions of the library. glooxwrapper replaces the gloox API with a version that is safe to use across compiler versions. glooxwrapper and gloox must be compiled together with the diff --git a/source/scriptinterface/NativeWrapperDefns.h b/source/scriptinterface/NativeWrapperDefns.h index b5fbcaeb75..6650fb4bf8 100644 --- a/source/scriptinterface/NativeWrapperDefns.h +++ b/source/scriptinterface/NativeWrapperDefns.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -45,13 +45,13 @@ PASS_BY_VALUE_IN_NATIVE_WRAPPER(double) #undef PASS_BY_VALUE_IN_NATIVE_WRAPPER -// This works around a bug in Visual Studio 2013 (error C2244 if ScriptInterface:: is included in the +// This works around a bug in Visual Studio (error C2244 if ScriptInterface:: is included in the // type specifier of MaybeRef::Type for parameters inside the member function declaration). // It's probably the bug described here, but I'm not quite sure (at least the example there still // cause error C2244): // https://connect.microsoft.com/VisualStudio/feedback/details/611863/vs2010-c-fails-with-error-c2244-gcc-4-3-4-compiles-ok // -// TODO: When dropping support for VS 2013, check if this bug is still present in the supported +// TODO: When dropping support for VS 2015, check if this bug is still present in the supported // Visual Studio versions (replace the macro definitions in NativeWrapperDecls.h with these ones, // remove them from here and check if this causes error C2244 when compiling. #undef NUMBERED_LIST_TAIL_MAYBE_REF diff --git a/source/scriptinterface/ScriptInterface.h b/source/scriptinterface/ScriptInterface.h index afb91f2b93..d0f13ad5c8 100644 --- a/source/scriptinterface/ScriptInterface.h +++ b/source/scriptinterface/ScriptInterface.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -427,25 +427,6 @@ private: struct CustomType { - // TODO: Move assignment operator and move constructor only have to be - // explicitly defined for Visual Studio. VS2013 is still behind on C++11 support - // What's missing is what they call "Rvalue references v3.0", see - // https://msdn.microsoft.com/en-us/library/hh567368.aspx#rvref - CustomType() {} - CustomType& operator=(CustomType&& other) - { - m_Prototype = std::move(other.m_Prototype); - m_Class = std::move(other.m_Class); - m_Constructor = std::move(other.m_Constructor); - return *this; - } - CustomType(CustomType&& other) - { - m_Prototype = std::move(other.m_Prototype); - m_Class = std::move(other.m_Class); - m_Constructor = std::move(other.m_Constructor); - } - JS::PersistentRootedObject m_Prototype; JSClass* m_Class; JSNative m_Constructor; diff --git a/source/scriptinterface/ScriptVal.h b/source/scriptinterface/ScriptVal.h index 1692bf0fbf..42d9cae2c1 100644 --- a/source/scriptinterface/ScriptVal.h +++ b/source/scriptinterface/ScriptVal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -78,21 +78,6 @@ public: m_Val.reset(new JS::PersistentRooted(cx, val)); } - // TODO: Move assignment operator and move constructor only have to be - // explicitly defined for Visual Studio. VS2013 is still behind on C++11 support - // What's missing is what they call "Rvalue references v3.0", see - // https://msdn.microsoft.com/en-us/library/hh567368.aspx#rvref - DefPersistentRooted& operator=(DefPersistentRooted&& other) - { - m_Val = std::move(other.m_Val); - return *this; - } - - DefPersistentRooted(DefPersistentRooted&& other) - { - m_Val = std::move(other.m_Val); - } - private: std::unique_ptr > m_Val; }; diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp index ea9e32d37a..5e1df9d0d3 100644 --- a/source/simulation2/system/ComponentManager.cpp +++ b/source/simulation2/system/ComponentManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -248,7 +248,7 @@ void CComponentManager::Script_RegisterComponentType_Common(ScriptInterface::CxP componentManager->m_ScriptInterface.GetProperty(protoVal, "Schema", schema); // Construct a new ComponentType, using the wrapper's alloc functions - ComponentType ct( + ComponentType ct{ CT_Script, iid, ctWrapper.alloc, @@ -256,7 +256,7 @@ void CComponentManager::Script_RegisterComponentType_Common(ScriptInterface::CxP cname, schema, DefPersistentRooted(cx, ctor) - ); + }; componentManager->m_ComponentTypesById[cid] = std::move(ct); componentManager->m_CurrentComponent = cid; // needed by Subscribe @@ -533,7 +533,7 @@ void CComponentManager::SetRNGSeed(u32 seed) void CComponentManager::RegisterComponentType(InterfaceId iid, ComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char* name, const std::string& schema) { - ComponentType c(CT_Native, iid, alloc, dealloc, name, schema, DefPersistentRooted()); + ComponentType c{ CT_Native, iid, alloc, dealloc, name, schema, DefPersistentRooted() }; m_ComponentTypesById.insert(std::make_pair(cid, std::move(c))); m_ComponentTypeIdsByName[name] = cid; } @@ -541,7 +541,7 @@ void CComponentManager::RegisterComponentType(InterfaceId iid, ComponentTypeId c void CComponentManager::RegisterComponentTypeScriptWrapper(InterfaceId iid, ComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char* name, const std::string& schema) { - ComponentType c(CT_ScriptWrapper, iid, alloc, dealloc, name, schema, DefPersistentRooted()); + ComponentType c{ CT_ScriptWrapper, iid, alloc, dealloc, name, schema, DefPersistentRooted() }; m_ComponentTypesById.insert(std::make_pair(cid, std::move(c))); m_ComponentTypeIdsByName[name] = cid; // TODO: merge with RegisterComponentType diff --git a/source/simulation2/system/ComponentManager.h b/source/simulation2/system/ComponentManager.h index 372b7f07cd..bf2bfa7e2a 100644 --- a/source/simulation2/system/ComponentManager.h +++ b/source/simulation2/system/ComponentManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -72,46 +72,6 @@ private: std::string name; std::string schema; // RelaxNG fragment DefPersistentRooted ctor; // only valid if type == CT_Script - - // TODO: Constructor, move assignment operator and move constructor only have to be - // explicitly defined for Visual Studio. VS2013 is still behind on C++11 support - // What's missing is what they call "Rvalue references v3.0", see - // https://msdn.microsoft.com/en-us/library/hh567368.aspx#rvref - ComponentType() {} - ComponentType (EComponentTypeType type, InterfaceId iid, AllocFunc alloc, - DeallocFunc dealloc, std::string name, std::string schema, DefPersistentRooted ctor) : - type(type), - iid(iid), - alloc(alloc), - dealloc(dealloc), - name(name), - schema(schema), - ctor(std::move(ctor)) - { - } - - ComponentType& operator= (ComponentType&& other) - { - type = std::move(other.type); - iid = std::move(other.iid); - alloc = std::move(other.alloc); - dealloc = std::move(other.dealloc); - name = std::move(other.name); - schema = std::move(other.schema); - ctor = std::move(other.ctor); - return *this; - } - - ComponentType(ComponentType&& other) - { - type = std::move(other.type); - iid = std::move(other.iid); - alloc = std::move(other.alloc); - dealloc = std::move(other.dealloc); - name = std::move(other.name); - schema = std::move(other.schema); - ctor = std::move(other.ctor); - } }; public: