From 86d34ae9f0559e524d3e0f12f6003ec700cb9bb5 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 2 Oct 2020 21:33:25 +0200 Subject: [PATCH] Use standard macro to check C++ version. --- CMakeLists.txt | 2 -- src/mc/sosp/PageStore.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bae099b0eb..e97ab04a00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -795,9 +795,7 @@ endif() if (enable_model-checking AND (NOT ("cxx_std_14" IN_LIST known_features))) message(WARNING "C++14 not found. The model-checker will use a slow hash function. You should upgrade your compiler") - set(SG_HAVE_CPP14 0) else() - set(SG_HAVE_CPP14 1) set_property(TARGET simgrid PROPERTY CXX_STANDARD 14) endif() diff --git a/src/mc/sosp/PageStore.cpp b/src/mc/sosp/PageStore.cpp index ef1568c024..0a070d4a46 100644 --- a/src/mc/sosp/PageStore.cpp +++ b/src/mc/sosp/PageStore.cpp @@ -12,7 +12,7 @@ #include "xbt/log.h" #include "xbt/sysdep.h" -#ifdef SG_HAVE_CPP14 +#if __cplusplus >= 201402L #include "src/include/xxhash.hpp" #endif #include "src/mc/mc_mmu.hpp" @@ -34,7 +34,7 @@ namespace mc { */ static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data) { -#ifdef SG_HAVE_CPP14 +#ifdef __cplusplus >= 201402L return xxh::xxhash<64>(data, xbt_pagesize); #else const std::uint64_t* values = (const uint64_t*)data; -- 2.20.1