Chris@16: // (C) Copyright John Maddock 2001 - 2003. Chris@16: // (C) Copyright Darin Adler 2001 - 2002. Chris@16: // (C) Copyright Jens Maurer 2001 - 2002. Chris@16: // (C) Copyright Beman Dawes 2001 - 2003. Chris@16: // (C) Copyright Douglas Gregor 2002. Chris@16: // (C) Copyright David Abrahams 2002 - 2003. Chris@16: // (C) Copyright Synge Todo 2003. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for most recent version. Chris@16: Chris@16: // GNU C++ compiler setup. Chris@16: Chris@16: // Chris@16: // Define BOOST_GCC so we know this is "real" GCC and not some pretender: Chris@16: // Chris@16: #if !defined(__CUDACC__) Chris@16: #define BOOST_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) Chris@16: #endif Chris@16: Chris@16: #if __GNUC__ == 3 Chris@16: # if defined (__PATHSCALE__) Chris@16: # define BOOST_NO_TWO_PHASE_NAME_LOOKUP Chris@16: # define BOOST_NO_IS_ABSTRACT Chris@16: # endif Chris@16: Chris@16: # if __GNUC_MINOR__ < 4 Chris@16: # define BOOST_NO_IS_ABSTRACT Chris@16: # endif Chris@16: # define BOOST_NO_CXX11_EXTERN_TEMPLATE Chris@16: #endif Chris@16: #if __GNUC__ < 4 Chris@16: // Chris@16: // All problems to gcc-3.x and earlier here: Chris@16: // Chris@16: #define BOOST_NO_TWO_PHASE_NAME_LOOKUP Chris@16: # ifdef __OPEN64__ Chris@16: # define BOOST_NO_IS_ABSTRACT Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: // GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links Chris@16: #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) Chris@16: #define BOOST_HAS_PRAGMA_ONCE Chris@16: #endif Chris@16: Chris@16: #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 ) Chris@16: // Previous versions of GCC did not completely implement value-initialization: Chris@16: // GCC Bug 30111, "Value-initialization of POD base class doesn't initialize Chris@16: // members", reported by Jonathan Wakely in 2006, Chris@16: // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4) Chris@16: // GCC Bug 33916, "Default constructor fails to initialize array members", Chris@16: // reported by Michael Elizabeth Chastain in 2007, Chris@16: // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4) Chris@16: // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues Chris@16: #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION Chris@16: #endif Chris@16: Chris@16: #if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS) Chris@16: # define BOOST_NO_EXCEPTIONS Chris@16: #endif Chris@16: Chris@16: Chris@16: // Chris@16: // Threading support: Turn this on unconditionally here (except for Chris@16: // those platforms where we can know for sure). It will get turned off again Chris@16: // later if no threading API is detected. Chris@16: // Chris@16: #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) Chris@16: # define BOOST_HAS_THREADS Chris@16: #endif Chris@16: Chris@16: // Chris@16: // gcc has "long long" Chris@16: // Chris@16: #define BOOST_HAS_LONG_LONG Chris@16: Chris@16: // Chris@16: // gcc implements the named return value optimization since version 3.1 Chris@16: // Chris@16: #define BOOST_HAS_NRVO Chris@16: Chris@16: // Branch prediction hints Chris@16: #define BOOST_LIKELY(x) __builtin_expect(x, 1) Chris@16: #define BOOST_UNLIKELY(x) __builtin_expect(x, 0) Chris@16: Chris@16: // Chris@16: // Dynamic shared object (DSO) and dynamic-link library (DLL) support Chris@16: // Chris@16: #if __GNUC__ >= 4 Chris@16: # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) Chris@16: // All Win32 development environments, including 64-bit Windows and MinGW, define Chris@16: // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, Chris@16: // so does not define _WIN32 or its variants. Chris@16: # define BOOST_HAS_DECLSPEC Chris@16: # define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__)) Chris@16: # define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__)) Chris@16: # else Chris@16: # define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default"))) Chris@16: # define BOOST_SYMBOL_IMPORT Chris@16: # endif Chris@16: # define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default"))) Chris@16: #else Chris@16: // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined Chris@16: # define BOOST_SYMBOL_EXPORT Chris@16: #endif Chris@16: Chris@16: // Chris@16: // RTTI and typeinfo detection is possible post gcc-4.3: Chris@16: // Chris@16: #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403 Chris@16: # ifndef __GXX_RTTI Chris@16: # ifndef BOOST_NO_TYPEID Chris@16: # define BOOST_NO_TYPEID Chris@16: # endif Chris@16: # ifndef BOOST_NO_RTTI Chris@16: # define BOOST_NO_RTTI Chris@16: # endif Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: // Chris@16: // Recent GCC versions have __int128 when in 64-bit mode. Chris@16: // Chris@16: // We disable this if the compiler is really nvcc as it Chris@16: // doesn't actually support __int128 as of CUDA_VERSION=5000 Chris@16: // even though it defines __SIZEOF_INT128__. Chris@16: // See https://svn.boost.org/trac/boost/ticket/8048 Chris@16: // Only re-enable this for nvcc if you're absolutely sure Chris@16: // of the circumstances under which it's supported: Chris@16: // Chris@16: #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) Chris@16: # define BOOST_HAS_INT128 Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.3.n and later Chris@16: // Chris@16: #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are Chris@16: // passed on the command line, which in turn defines Chris@16: // __GXX_EXPERIMENTAL_CXX0X__. Chris@16: # define BOOST_HAS_DECLTYPE Chris@16: # define BOOST_HAS_RVALUE_REFS Chris@16: # define BOOST_HAS_STATIC_ASSERT Chris@16: # define BOOST_HAS_VARIADIC_TMPL Chris@16: #else Chris@16: # define BOOST_NO_CXX11_DECLTYPE Chris@16: # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS Chris@16: # define BOOST_NO_CXX11_RVALUE_REFERENCES Chris@16: # define BOOST_NO_CXX11_STATIC_ASSERT Chris@16: Chris@16: // Variadic templates compiler: Chris@16: // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html Chris@16: # if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__)) Chris@16: # define BOOST_HAS_VARIADIC_TMPL Chris@16: # else Chris@16: # define BOOST_NO_CXX11_VARIADIC_TEMPLATES Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.4.n and later Chris@16: // Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: # define BOOST_NO_CXX11_AUTO_DECLARATIONS Chris@16: # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS Chris@16: # define BOOST_NO_CXX11_CHAR16_T Chris@16: # define BOOST_NO_CXX11_CHAR32_T Chris@16: # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST Chris@16: # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS Chris@16: # define BOOST_NO_CXX11_DELETED_FUNCTIONS Chris@16: # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES Chris@16: # define BOOST_NO_CXX11_INLINE_NAMESPACES Chris@16: #endif Chris@16: Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) Chris@16: # define BOOST_NO_SFINAE_EXPR Chris@16: #endif Chris@16: Chris@16: // GCC 4.5 forbids declaration of defaulted functions in private or protected sections Chris@16: #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) Chris@16: # define BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.5.0 and later Chris@16: // Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS Chris@16: # define BOOST_NO_CXX11_LAMBDAS Chris@16: # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS Chris@16: # define BOOST_NO_CXX11_RAW_LITERALS Chris@16: # define BOOST_NO_CXX11_UNICODE_LITERALS Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.5.1 and later Chris@16: // Chris@16: #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1 Chris@16: // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 Chris@16: # define BOOST_NO_CXX11_SCOPED_ENUMS Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.6.n and later Chris@16: // Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: #define BOOST_NO_CXX11_CONSTEXPR Chris@16: #define BOOST_NO_CXX11_NOEXCEPT Chris@16: #define BOOST_NO_CXX11_NULLPTR Chris@16: #define BOOST_NO_CXX11_RANGE_BASED_FOR Chris@16: #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.7.n and later Chris@16: // Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: # define BOOST_NO_CXX11_TEMPLATE_ALIASES Chris@16: # define BOOST_NO_CXX11_USER_DEFINED_LITERALS Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.8.n and later Chris@16: // Chris@16: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: # define BOOST_NO_CXX11_ALIGNAS Chris@16: #endif Chris@16: Chris@16: // C++0x features in 4.8.1 and later Chris@16: // Chris@16: #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__) Chris@16: # define BOOST_NO_CXX11_DECLTYPE_N3276 Chris@16: #endif Chris@16: Chris@16: #ifndef BOOST_COMPILER Chris@16: # define BOOST_COMPILER "GNU C++ version " __VERSION__ Chris@16: #endif Chris@16: Chris@16: // ConceptGCC compiler: Chris@16: // http://www.generic-programming.org/software/ConceptGCC/ Chris@16: #ifdef __GXX_CONCEPTS__ Chris@16: # define BOOST_HAS_CONCEPTS Chris@16: # define BOOST_COMPILER "ConceptGCC version " __VERSION__ Chris@16: #endif Chris@16: Chris@16: // versions check: Chris@16: // we don't know gcc prior to version 3.30: Chris@16: #if (__GNUC__ < 3) || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3)) Chris@16: # error "Compiler not configured - please reconfigure" Chris@16: #endif Chris@16: // Chris@16: // last known and checked version is 4.6 (Pre-release): Chris@16: #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) Chris@16: # if defined(BOOST_ASSERT_CONFIG) Chris@16: # error "Unknown compiler version - please run the configure tests and report the results" Chris@16: # else Chris@16: // we don't emit warnings here anymore since there are no defect macros defined for Chris@16: // gcc post 3.4, so any failures are gcc regressions... Chris@16: //# warning "Unknown compiler version - please run the configure tests and report the results" Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: