Downgrade to C++17
This commit is contained in:
+5
-8
@@ -87,7 +87,7 @@ else()
|
||||
${SMDATA_ALL_FILES_HPP})
|
||||
endif()
|
||||
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY CXX_STANDARD 20)
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY CXX_EXTENSIONS ON)
|
||||
|
||||
@@ -123,18 +123,15 @@ if (POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif()
|
||||
|
||||
# COMPILE_WARNING_AS_ERROR is only supported starting with cmake 3.24.
|
||||
# Continue using -Werror and /WX to treat warnings as errors until cmake >= 3.24 is required.
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY COMPILE_WARNING_AS_ERROR ON)
|
||||
target_compile_options("${SM_EXE_NAME}" PRIVATE
|
||||
$<$<CXX_COMPILER_ID:GNU>:
|
||||
-Werror -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas>
|
||||
-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas>
|
||||
$<$<CXX_COMPILER_ID:Clang>:
|
||||
-Werror -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas -Wno-undefined-var-template>
|
||||
-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas -Wno-undefined-var-template>
|
||||
$<$<CXX_COMPILER_ID:AppleClang>:
|
||||
-Werror -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas -Wno-undefined-var-template -Wno-deprecated-declarations -Wno-unused-command-line-argument>
|
||||
-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-unknown-pragmas -Wno-undefined-var-template -Wno-deprecated-declarations -Wno-unused-command-line-argument>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:
|
||||
/WX /W4 /wd4100 /wd4189 /wd4244 /wd4267 /wd4702>
|
||||
/W4 /wd4100 /wd4189 /wd4244 /wd4267 /wd4702>
|
||||
)
|
||||
|
||||
set(SM_COMPILE_FLAGS "")
|
||||
|
||||
+4
-6
@@ -4,7 +4,6 @@
|
||||
#define RAGE_UTIL_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <map>
|
||||
#include <random>
|
||||
#include <vector>
|
||||
@@ -189,15 +188,14 @@ namespace Endian
|
||||
{
|
||||
// When std::endian is supported by all desired compilers, we can eliminate the #ifdefs
|
||||
// (At least) the current compiler used for the Ubuntu 20.04 build does not support this.
|
||||
#if defined(__cpp_lib_endian)
|
||||
inline constexpr bool little = std::endian::native == std::endian::little;
|
||||
inline constexpr bool big = std::endian::native == std::endian::big;
|
||||
#if defined(__BYTE_ORDER__)
|
||||
inline constexpr bool little = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
|
||||
inline constexpr bool big = __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;
|
||||
#elif defined(_WIN32)
|
||||
inline constexpr bool little = false;
|
||||
inline constexpr bool big = true;
|
||||
#else
|
||||
inline constexpr bool little = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
|
||||
inline constexpr bool big = __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;
|
||||
#error "unknown byte order"
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -576,7 +576,12 @@ void SongManager::UnlistSong(Song *song)
|
||||
std::vector<Song*>* songVectors[3] = { &m_pSongs, &m_pPopularSongs, &m_pShuffledSongs };
|
||||
for (int songVecIdx=0; songVecIdx<3; ++songVecIdx) {
|
||||
std::vector<Song*>& v = *songVectors[songVecIdx];
|
||||
std::erase_if( v, [song](Song* vSong){return vSong == song;} );
|
||||
for (size_t i=0; i<v.size(); ++i) {
|
||||
if (v[i] == song) {
|
||||
v.erase(v.begin()+i);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user