From d6e962c91e0ad95b94f9f427dfd1ca1860633a99 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 Oct 2020 11:39:59 +0200 Subject: [PATCH] - upgraded code base to C++17. Mainly to allow using 'if constexpr'. Older CI compiler setups like GCC 5 for Linux were removed as a consequence. Windows 32 bit was also removed because there are no plans to do any more 32 bit releases of GZDoom. --- .github/workflows/continuous_integration.yml | 14 -------------- CMakeLists.txt | 7 ++++++- src/common/engine/sc_man.cpp | 2 +- src/playsim/fragglescript/t_func.cpp | 4 ++-- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index fc0a6cfa2..40445faf1 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -22,12 +22,6 @@ jobs: extra_options: "-A x64", build_type: "Debug" } - - { - name: "Visual Studio 32-bit", - os: windows-latest, - extra_options: "-A Win32 -DFORCE_INTERNAL_ZLIB=ON", - build_type: "Release" - } - { name: "macOS", os: macos-latest, @@ -40,14 +34,6 @@ jobs: os: macos-latest, build_type: "Debug" } - - { - name: "Linux GCC 5", - os: ubuntu-latest, - extra_options: "-DCMAKE_C_COMPILER=/usr/bin/gcc-5 -DCMAKE_CXX_COMPILER=/usr/bin/g++-5 \ - -DDYN_FLUIDSYNTH=OFF -DDYN_OPENAL=OFF -DDYN_SNDFILE=OFF -DDYN_MPG123=OFF", - deps_cmdline: "sudo apt update && sudo apt install g++-5 libsdl2-dev libopenal-dev libfluidsynth-dev libmpg123-dev libsndfile1-dev", - build_type: "MinSizeRel" - } - { name: "Linux GCC 7", os: ubuntu-latest, diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e59452f2..5d6a76421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,11 @@ -cmake_minimum_required( VERSION 2.8.7 ) +cmake_minimum_required( VERSION 3.1.0 ) project(GZDoom) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + + if( COMMAND cmake_policy ) if( POLICY CMP0011 ) cmake_policy( SET CMP0011 NEW ) diff --git a/src/common/engine/sc_man.cpp b/src/common/engine/sc_man.cpp index e3225d396..41b5c7719 100644 --- a/src/common/engine/sc_man.cpp +++ b/src/common/engine/sc_man.cpp @@ -1247,7 +1247,7 @@ void FScanner::AddSymbol(const char* name, uint64_t value) Symbol sym; sym.tokenType = TK_UIntConst; sym.Number = value; - sym.Float = value; + sym.Float = (double)value; symbols.Insert(name, sym); } diff --git a/src/playsim/fragglescript/t_func.cpp b/src/playsim/fragglescript/t_func.cpp index c2df2c659..889d820f2 100644 --- a/src/playsim/fragglescript/t_func.cpp +++ b/src/playsim/fragglescript/t_func.cpp @@ -1879,7 +1879,7 @@ void FParser::SF_FloorTexture(void) t_return.type = svt_string; auto tex = TexMan.GetGameTexture(sector->GetTexture(sector_t::floor)); - t_return.string = tex? tex->GetName() : ""; + t_return.string = tex? tex->GetName() : FString(); } } @@ -1969,7 +1969,7 @@ void FParser::SF_CeilingTexture(void) t_return.type = svt_string; auto tex = TexMan.GetGameTexture(sector->GetTexture(sector_t::ceiling)); - t_return.string = tex? tex->GetName() : ""; + t_return.string = tex? tex->GetName() : FString(); } }