From 5afd12e8a4148e5fcf8bcc1bbea528a0d1f7ca47 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 24 Aug 2018 00:32:40 +0300 Subject: [PATCH] [CMake] Use C++17 --- rpcs3/CMakeLists.txt | 2 +- rpcs3/Emu/RSX/rsx_utils.h | 11 ++--------- rpcs3/stdafx.h | 10 ---------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 0d0d2e3e24..9192906df8 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules") set(RES_FILES "") -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) include(CheckCXXCompilerFlag) # Qt section diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index a6981ec7e3..693a6d524a 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -6,14 +6,7 @@ #include #include #include - -// TODO: replace the code below by #include when C++17 or newer will be used -#include -namespace std -{ - template - using optional = experimental::optional; -} +#include extern "C" { @@ -686,7 +679,7 @@ namespace rsx return dst_index; } - // The rsx internally adds the 'data_base_offset' and the 'vert_offset' and masks it + // The rsx internally adds the 'data_base_offset' and the 'vert_offset' and masks it // before actually attempting to translate to the internal address. Seen happening heavily in R&C games static inline u32 get_vertex_offset_from_base(u32 vert_data_base_offset, u32 vert_base_offset) { diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 2d4658f645..0c40854b0c 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -45,13 +45,3 @@ namespace std { inline namespace literals { inline namespace chrono_literals {}} #include using namespace std::literals; - -// Remove once we move to C++17 -namespace std -{ - template - constexpr const T clamp(const T value, const T min, const T max) - { - return value < min ? min : value > max ? max : value; - } -}