From fb0443db69dc5c19bb7afb86b978f0c8a28ff770 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 10 Apr 2019 01:00:38 +0000 Subject: [PATCH] Replace `#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800)` with `#ifdef HAVE_CXX11_HEADERS` git-svn-id: https://svn.eduke32.com/eduke32@7557 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/collections.h | 2 +- source/build/include/compat.h | 10 ++++++---- source/build/include/print.h | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/build/include/collections.h b/source/build/include/collections.h index 2684e2f8b..7aba68cf9 100644 --- a/source/build/include/collections.h +++ b/source/build/include/collections.h @@ -6,7 +6,7 @@ #include "compat.h" -#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +#ifdef HAVE_CXX11_HEADERS // GrowArray - heap-allocated storage that can expand at runtime // requirements: type must work properly with realloc -- otherwise, use std::vector diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 8e4774b09..502611640 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -435,6 +435,8 @@ defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_IA64 || # include # include # include +// we need this because MSVC does not properly identify C++11 support +# define HAVE_CXX11_HEADERS # endif #endif @@ -716,7 +718,7 @@ void eduke32_exit_return(int) ATTRIBUTE((noreturn)); #ifdef __cplusplus -# if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +# ifdef HAVE_CXX11_HEADERS using std::is_integral; template struct is_signed @@ -735,7 +737,7 @@ using std::enable_if_t; using std::conditional_t; using std::make_signed_t; using std::make_unsigned_t; -# elif CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +# elif defined HAVE_CXX11_HEADERS template using enable_if_t = typename std::enable_if::type; template @@ -796,7 +798,7 @@ typedef size_t reg_t; typedef ssize_t sreg_t; #endif -#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +#ifdef HAVE_CXX11_HEADERS using native_t = typename integers_of_size::i; using unative_t = typename integers_of_size::u; #else @@ -1099,7 +1101,7 @@ ABSTRACT_DECL float fclamp2(float in, float min, float max) { return in >= max ? ////////// Mathematical operations ////////// #ifdef __cplusplus -#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +#ifdef HAVE_CXX11_HEADERS template struct DivResult { diff --git a/source/build/include/print.h b/source/build/include/print.h index 665600d7e..c3362fd8c 100644 --- a/source/build/include/print.h +++ b/source/build/include/print.h @@ -4,7 +4,7 @@ #ifndef print_h_ #define print_h_ -#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800) +#ifdef HAVE_CXX11_HEADERS template struct binwrap