From f2a127230302823edadf25c2976c41b6aaacc719 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 27 Jan 2020 10:03:00 -0800 Subject: [PATCH] Use VS 2017 and 2019 on CI, fix cast issue in dart_idl (#5740) * vs2019 * another attempt * syntax * fewer * fix dart --- appveyor.yml | 23 +++++++++++++++++------ src/idl_gen_dart.cpp | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f60e6e397..ee6930f6c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,6 @@ branches: only: - master -os: Visual Studio 2015 - environment: global: @@ -14,15 +12,26 @@ environment: CPP_TEST_OPTIONS: "" matrix: - - CMAKE_VS_VERSION: "10 2010" + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_VS_VERSION: "10 2010" CMAKE_OPTIONS: "-DFLATBUFFERS_BUILD_LEGACY=1" CPP_TEST_OPTIONS: "--std-cpp c++0x" MONSTER_EXTRA: "skip" - - CMAKE_VS_VERSION: "12 2013" + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_VS_VERSION: "12 2013" MONSTER_EXTRA: "skip" - - CMAKE_VS_VERSION: "14 2015" + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CMAKE_VS_VERSION: "14 2015" + MONSTER_EXTRA: "" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CMAKE_VS_VERSION: "15 2017" + MONSTER_EXTRA: "" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + CMAKE_VS_VERSION: "16 2019" MONSTER_EXTRA: "" platform: @@ -37,7 +46,9 @@ before_build: - set MONSTER_EXTRA=%MONSTER_EXTRA% - cmake . -G"Visual Studio %CMAKE_VS_VERSION%" -DFLATBUFFERS_CODE_SANITIZE=1 %CMAKE_OPTIONS% # This cuts down on a lot of noise generated by xamarin warnings. - - del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" + - if exist "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" + - if exist "C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" + - if exist "C:\Program Files (x86)\MSBuild\16.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\16.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" build: project: ALL_BUILD.vcxproj diff --git a/src/idl_gen_dart.cpp b/src/idl_gen_dart.cpp index b072d2937..aebb04729 100644 --- a/src/idl_gen_dart.cpp +++ b/src/idl_gen_dart.cpp @@ -454,7 +454,7 @@ class DartGenerator : public BaseGenerator { it != struct_def.fields.vec.end(); ++it) { auto &field = **it; if (field.deprecated) continue; - auto offset = it - struct_def.fields.vec.begin(); + auto offset = static_cast(it - struct_def.fields.vec.begin()); non_deprecated_fields.push_back(std::make_pair(offset, &field)); }