From 0c78d97ba5ee55cb35a54e4d31cff97e5f66a88b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 23:16:29 +0100 Subject: [PATCH] Better defaults for compiler capabilities. --- .../PolyVoxCore/Impl/CompilerCapabilities.h | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h index 2bbf6fda..074c3555 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h @@ -1,20 +1,23 @@ /* - * This file provides the default compiler capabilities for for Visual Studio. - * On other compilers CMake will detect which features are available and create - * a file like this. - * - * To Enable these features in Visual Studio, define the variables in this file. -*/ + * This file describes the capabilities of the C++ compiler and is used to determine which features to enable in PolyVox. + * It assumes that if the compiler is from VS2008 or earlier then no C++11 is present, otherwise it assumes full support + * is present. + * + * Not that this file is usually overwritten by CMake which does careful tests of the true compiler capabilities. However, + * we provide this default file so that CMake is not actually required for users of PolyVox and they can instead just drop + * PolyVox code into their project/makefile if they prefer. + */ #ifndef __PolyVox_CompilerCapabilities_H__ #define __PolyVox_CompilerCapabilities_H__ -//#define HAS_CXX11_CONSTEXPR - -//#define HAS_CXX11_STATIC_ASSERT - -//#define HAS_CXX11_CSTDINT_H - -#define HAS_CXX11_SHARED_PTR +// If we are not using Visual Studio (or we are but it +// is a recent version) then assume support for these. +#if !defined(_MSC_VER) || (_MSC_VER >= 1600) + #define HAS_CXX11_CONSTEXPR + #define HAS_CXX11_STATIC_ASSERT + #define HAS_CXX11_CSTDINT_H + #define HAS_CXX11_SHARED_PTR +#endif #endif