Compiler configuration logic for Clang.

[SVN r61626]
This commit is contained in:
Douglas Gregor
2010-04-27 19:45:08 +00:00
parent b54ad840b1
commit 69917116b8
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,65 @@
// (C) Copyright Douglas Gregor 2010
//
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// Clang compiler setup.
#if __has_feature(cxx_exceptions)
#else
# define BOOST_NO_EXCEPTIONS
#endif
#if __has_feature(cxx_rtti)
#else
# define BOOST_NO_RTTI
#endif
#if defined(__int32)
// HACK: Clang only defines the type __int32 in Microsoft-compatibility mode,
// which means that declspecs are also available
# define BOOST_HAS_DECLSPEC
#endif
#if defined(__int64)
# define BOOST_HAS_MS_INT64
#endif
// NOTE: Clang does not yet support NRVO.
// NOTE: Clang's C++0x support is not worth detecting. However, it
// supports both extern templates and "long long" even in C++98/03
// mode.
#define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CHAR16_T
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONCEPTS
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
// HACK: Clang does support extern templates, but Boost's test for
// them is wrong.
#define BOOST_NO_EXTERN_TEMPLATE
#ifndef BOOST_COMPILER
// NOTE: Clang does not expose a version number
# define BOOST_COMPILER "Clang C++"
#endif

View File

@ -15,6 +15,7 @@
// compilers we support:
# define BOOST_CXX_GCCXML 0
# define BOOST_CXX_CLANG 0
# define BOOST_CXX_COMO 0
# define BOOST_CXX_DMC 0
# define BOOST_CXX_INTEL 0
@ -49,6 +50,10 @@
// Comeau C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
#elif defined __clang__
// Clang C++ emulates GCC, so it has to appear early.
# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
#elif defined __DMC__
// Digital Mars C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"