From 1bc3e4657464afae834aa3d48c7f71bd3e76b48e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 26 May 2013 11:19:10 +0000 Subject: [PATCH] Merge config from Trunk - previous merge was incomplete. [SVN r84505] --- include/boost/config/compiler/borland.hpp | 1 + include/boost/config/compiler/clang.hpp | 14 ++++ include/boost/config/compiler/codegear.hpp | 1 + include/boost/config/compiler/common_edg.hpp | 1 + include/boost/config/compiler/cray.hpp | 1 + include/boost/config/compiler/digitalmars.hpp | 1 + include/boost/config/compiler/gcc.hpp | 10 ++- include/boost/config/compiler/gcc_xml.hpp | 3 +- include/boost/config/compiler/hp_acc.hpp | 1 + include/boost/config/compiler/metrowerks.hpp | 1 + include/boost/config/compiler/mpw.hpp | 1 + include/boost/config/compiler/pathscale.hpp | 1 + include/boost/config/compiler/pgi.hpp | 1 + include/boost/config/compiler/sunpro_cc.hpp | 1 + include/boost/config/compiler/vacpp.hpp | 1 + include/boost/config/compiler/visualc.hpp | 1 + include/boost/config/platform/vxworks.hpp | 83 ++++++++++++++++++- include/boost/config/stdlib/libstdcpp3.hpp | 3 +- include/boost/config/suffix.hpp | 13 ++- 19 files changed, 133 insertions(+), 6 deletions(-) diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index cffa8ea0..38ac4a9a 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -190,6 +190,7 @@ #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_NOEXCEPT #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #if __BORLANDC__ >= 0x590 # define BOOST_HAS_TR1_HASH diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 209c9007..8e38821b 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -38,6 +38,16 @@ # define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default"))) #endif +// +// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through +// between switch labels. +// +#if __cplusplus >= 201103L && defined(__has_warning) +# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define BOOST_FALLTHROUGH [[clang::fallthrough]] +# endif +#endif + #if !__has_feature(cxx_auto_type) # define BOOST_NO_CXX11_AUTO_DECLARATIONS # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS @@ -132,6 +142,10 @@ # define BOOST_NO_CXX11_VARIADIC_TEMPLATES #endif +#if !__has_feature(cxx_user_literals) +# define BOOST_NO_CXX11_USER_DEFINED_LITERALS +#endif + // Clang always supports variadic macros // Clang always supports extern templates diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index 1a6df335..9dd97bc0 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -110,6 +110,7 @@ #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS // // TR1 macros: diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index 441a055f..4b5d2d26 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -95,6 +95,7 @@ #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #ifdef c_plusplus // EDG has "long long" in non-strict mode diff --git a/include/boost/config/compiler/cray.hpp b/include/boost/config/compiler/cray.hpp index 5463ea08..4455c5c4 100644 --- a/include/boost/config/compiler/cray.hpp +++ b/include/boost/config/compiler/cray.hpp @@ -51,6 +51,7 @@ #define BOOST_NO_CXX11_DECLTYPE_N3276 #define BOOST_NO_CXX11_DECLTYPE #define BOOST_NO_CXX11_CONSTEXPR +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION #define BOOST_NO_CXX11_CHAR32_T #define BOOST_NO_CXX11_CHAR16_T diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index 15cc209d..0206dc38 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -86,6 +86,7 @@ #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #if (__DMC__ < 0x812) #define BOOST_NO_CXX11_VARIADIC_MACROS diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 27a314da..b3d12ec6 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -236,12 +236,18 @@ #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX #endif +// C++0x features in 4.7.n and later +// #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) # define BOOST_NO_CXX11_TEMPLATE_ALIASES +# define BOOST_NO_CXX11_USER_DEFINED_LITERALS #endif -// C++0x features not supported at all yet + +// C++0x features in 4.8.1 and later // -#define BOOST_NO_CXX11_DECLTYPE_N3276 +#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_NO_CXX11_DECLTYPE_N3276 +#endif #ifndef BOOST_COMPILER # define BOOST_COMPILER "GNU C++ version " __VERSION__ diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index eaed4b5a..1af2fc1a 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -53,7 +53,8 @@ # define BOOST_NO_CXX11_RAW_LITERALS # define BOOST_NO_CXX11_UNICODE_LITERALS # define BOOST_NO_CXX11_NOEXCEPT -#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +# define BOOST_NO_CXX11_USER_DEFINED_LITERALS #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ diff --git a/include/boost/config/compiler/hp_acc.hpp b/include/boost/config/compiler/hp_acc.hpp index 4f5f81b3..12c791b3 100644 --- a/include/boost/config/compiler/hp_acc.hpp +++ b/include/boost/config/compiler/hp_acc.hpp @@ -118,6 +118,7 @@ #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS /* See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and diff --git a/include/boost/config/compiler/metrowerks.hpp b/include/boost/config/compiler/metrowerks.hpp index 184cb71c..4ca8af8a 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -119,6 +119,7 @@ #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_VARIADIC_MACROS #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp index 14adee0c..7ef38efa 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -68,6 +68,7 @@ #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_VARIADIC_MACROS #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS // // versions check: diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index 30411263..07d14609 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -76,5 +76,6 @@ # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE # define BOOST_NO_CXX11_HDR_CODECVT # define BOOST_NO_CXX11_HDR_CHRONO +# define BOOST_NO_CXX11_USER_DEFINED_LITERALS #endif diff --git a/include/boost/config/compiler/pgi.hpp b/include/boost/config/compiler/pgi.hpp index fa32fefb..64c0d753 100644 --- a/include/boost/config/compiler/pgi.hpp +++ b/include/boost/config/compiler/pgi.hpp @@ -111,6 +111,7 @@ #define BOOST_NO_CXX11_HDR_CODECVT #define BOOST_NO_CXX11_HDR_CHRONO #define BOOST_NO_CXX11_HDR_ARRAY +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS // // version check: diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index 65beb501..88421ee4 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -127,6 +127,7 @@ #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_VARIADIC_MACROS #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS // // Version diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index 9792e00e..47b99031 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -106,6 +106,7 @@ #define BOOST_NO_CXX11_NULLPTR #define BOOST_NO_CXX11_RANGE_BASED_FOR #define BOOST_NO_CXX11_RAW_LITERALS +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #if ! __IBMCPP_RVALUE_REFERENCES # define BOOST_NO_CXX11_RVALUE_REFERENCES #endif diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 83beab9a..83e8e3d7 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -241,6 +241,7 @@ #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_SFINAE_EXPR #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS // // prefix and suffix headers: diff --git a/include/boost/config/platform/vxworks.hpp b/include/boost/config/platform/vxworks.hpp index 0ad22c97..cdda0158 100644 --- a/include/boost/config/platform/vxworks.hpp +++ b/include/boost/config/platform/vxworks.hpp @@ -21,10 +21,91 @@ // of executables differ largely in the available functionality of // the C-library, STL, and so on. A DKM uses a library similar to those // of vxWorks 5.X - with all its limitations and incompatibilities -// in respect to ANSI C++ and STL. So probably there might be problems +// with respect to ANSI C++ and STL. So probably there might be problems // with the usage of boost from DKMs. WRS or any voluteers are free to // prove the opposite! +// ==================================================================== +// +// Some important information regarding the usage of POSIX semaphores: +// ------------------------------------------------------------------- +// +// VxWorks as a real time operating system handles threads somewhat +// different from what "normal" OSes do, regarding their scheduling! +// This could lead to a scenario called "priority inversion" when using +// semaphores, see http://en.wikipedia.org/wiki/Priority_inversion. +// +// Now, VxWorks POSIX-semaphores for DKM's default to the usage of +// priority inverting semaphores, which is fine. On the other hand, +// for RTP's it defaults to using non priority inverting semaphores, +// which could easily pose a serious problem for a real time process, +// i.e. deadlocks! To overcome this two possibilities do exist: +// +// a) Patch every piece of boost that uses semaphores to instanciate +// the proper type of semaphores. This is non-intrusive with respect +// to the OS and could relatively easy been done by giving all +// semaphores attributes deviating from the default (for in-depth +// information see the POSIX functions pthread_mutexattr_init() +// and pthread_mutexattr_setprotocol()). However this breaks all +// too easily, as with every new version some boost library could +// all in a sudden start using semaphores, resurrecting the very +// same, hard to locate problem over and over again! +// +// b) We could change the default properties for POSIX-semaphores +// that VxWorks uses for RTP's and this is being suggested here, +// as it will more or less seamlessly integrate with boost. I got +// the following information from WRS how to do this, compare +// Wind River TSR# 1209768: +// +// Instructions for changing the default properties of POSIX- +// semaphores for RTP's in VxWorks 6.9: +// - Edit the file /vxworks-6.9/target/usr/src/posix/pthreadLib.c +// in the root of your Workbench-installation. +// - Around line 917 there should be the definition of the default +// mutex attributes: +// +// LOCAL pthread_mutexattr_t defaultMutexAttr = +// { +// PTHREAD_INITIALIZED_OBJ, PTHREAD_PRIO_NONE, 0, +// PTHREAD_MUTEX_DEFAULT +// }; +// +// Here, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT. +// - Around line 1236 there should be a definition for the function +// pthread_mutexattr_init(). A couple of lines below you should +// find a block of code like this: +// +// pAttr->mutexAttrStatus = PTHREAD_INITIALIZED_OBJ; +// pAttr->mutexAttrProtocol = PTHREAD_PRIO_NONE; +// pAttr->mutexAttrPrioceiling = 0; +// pAttr->mutexAttrType = PTHREAD_MUTEX_DEFAULT; +// +// Here again, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT. +// - Finally, rebuild your VSB. This will create a new VxWorks kernel +// with the changed properties. That's it! Now, using boost should +// no longer cause any problems with task deadlocks! +// +// And here's another useful piece of information concerning VxWorks' +// POSIX-functionality in general: +// VxWorks is not a genuine POSIX-OS in itself, rather it is using a +// kind of compatibility layer (sort of a wrapper) to emulate the +// POSIX-functionality by using its own resources and functions. +// At the time a task (thread) calls it's first POSIX-function during +// runtime it is being transformed by the OS into a POSIX-thread. +// This transformation does include a call to malloc() to allocate the +// memory required for the housekeeping of POSIX-threads. In a high +// priority RTP this malloc() call may be highly undesirable, as its +// timing is more or less unpredictable (depending on what your actual +// heap looks like). You can circumvent this problem by calling the +// function thread_self() at a well defined point in the code of the +// task, e.g. shortly after the task spawns up. Thereby you are able +// to define the time when the task-transformation will take place and +// you could shift it to an uncritical point where a malloc() call is +// tolerable. So, if this could pose a problem for your code, remember +// to call thread_self() from the affected task at an early stage. +// +// ==================================================================== + // Block out all versions before vxWorks 6.x, as these don't work: // Include header with the vxWorks version information and query them #include diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index c56dff22..976ab76b 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -35,7 +35,8 @@ # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ || defined(_GLIBCXX__PTHREADS) \ || defined(_GLIBCXX_HAS_GTHREADS) \ - || defined(_WIN32) + || defined(_WIN32) \ + || defined(_AIX) // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index d4524812..21591c9e 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -641,7 +641,8 @@ namespace std{ using ::type_info; } # if defined(_MSC_VER) # define BOOST_FORCEINLINE __forceinline # elif defined(__GNUC__) && __GNUC__ > 3 -# define BOOST_FORCEINLINE inline __attribute__ ((always_inline)) + // Clang also defines __GNUC__ (as 4) +# define BOOST_FORCEINLINE inline __attribute__ ((__always_inline__)) # else # define BOOST_FORCEINLINE inline # endif @@ -883,6 +884,16 @@ namespace std{ using ::type_info; } # define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate)) # define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression)) #endif +// +// Helper macro BOOST_FALLTHROUGH +// Fallback definition of BOOST_FALLTHROUGH macro used to mark intended +// fall-through between case labels in a switch statement. We use a definition +// that requires a semicolon after it to avoid at least one type of misuse even +// on unsupported compilers. +// +#ifndef BOOST_FALLTHROUGH +# define BOOST_FALLTHROUGH ((void)0) +#endif // // constexpr workarounds