src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp in passenger-5.3.3 vs src/cxx_supportlib/vendor-modified/boost/thread/detail/config.hpp in passenger-5.3.4

- old
+ new

@@ -10,27 +10,55 @@ #include <boost/config.hpp> #include <boost/detail/workaround.hpp> #include <boost/thread/detail/platform.hpp> -//#define BOOST_THREAD_USEFIXES_TIMESPEC -//#define BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS // ATTRIBUTE_MAY_ALIAS -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +//#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if !defined(BOOST_NO_MAY_ALIAS) - // GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with - // regard to violation of the strict aliasing rules. + // GCC since 3.3 and some other compilers have may_alias attribute that helps + // to alleviate optimizer issues with regard to violation of the strict aliasing rules. #define BOOST_THREAD_DETAIL_USE_ATTRIBUTE_MAY_ALIAS - #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) +#endif +#if defined(BOOST_MAY_ALIAS) +#define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS BOOST_MAY_ALIAS #else - #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS +#define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS #endif +#if defined(BOOST_THREAD_CHRONO_WINDOWS_API) +# warning Boost.Thread will use the Windows API for time +#elif defined(BOOST_THREAD_CHRONO_MAC_API) +# warning Boost.Thread will use the Mac API for time +#elif defined(BOOST_THREAD_CHRONO_POSIX_API) +# warning Boost.Thread will use the POSIX API for time +#endif +# if defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API ) +# error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_POSIX_API are defined +# elif defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && defined( BOOST_THREAD_CHRONO_MAC_API ) +# error both BOOST_THREAD_CHRONO_WINDOWS_API and BOOST_THREAD_CHRONO_MAC_API are defined +# elif defined( BOOST_THREAD_CHRONO_MAC_API ) && defined( BOOST_THREAD_CHRONO_POSIX_API ) +# error both BOOST_THREAD_CHRONO_MAC_API and BOOST_THREAD_CHRONO_POSIX_API are defined +# elif !defined( BOOST_THREAD_CHRONO_WINDOWS_API ) && !defined( BOOST_THREAD_CHRONO_MAC_API ) && !defined( BOOST_THREAD_CHRONO_POSIX_API ) +# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) +# define BOOST_THREAD_CHRONO_WINDOWS_API +# elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) +# define BOOST_THREAD_CHRONO_MAC_API +# else +# define BOOST_THREAD_CHRONO_POSIX_API +# endif +# endif + +#if !defined(BOOST_THREAD_POLL_INTERVAL_MILLISECONDS) +#define BOOST_THREAD_POLL_INTERVAL_MILLISECONDS 100 +#endif + #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED #define BOOST_THREAD_ASSERT_PRECONDITION(EXPR, EX) \ if (EXPR) {} else boost::throw_exception(EX) #define BOOST_THREAD_VERIFY_PRECONDITION(EXPR, EX) \ if (EXPR) {} else boost::throw_exception(EX) @@ -93,11 +121,11 @@ #define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID #endif /// RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR //#if defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC -#define BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR +#define BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNCTION_PTR //#endif // Default version #if !defined BOOST_THREAD_VERSION #define BOOST_THREAD_VERSION 2 @@ -382,13 +410,36 @@ # if defined(BOOST_HAS_PTHREAD_DELAY_NP) || defined(BOOST_HAS_NANOSLEEP) # define BOOST_THREAD_SLEEP_FOR_IS_STEADY # endif #endif +#if defined(BOOST_THREAD_CHRONO_WINDOWS_API) + #define BOOST_THREAD_HAS_MONO_CLOCK + #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO +#elif defined(BOOST_THREAD_CHRONO_MAC_API) + #define BOOST_THREAD_HAS_MONO_CLOCK +#else + #include <time.h> // check for CLOCK_MONOTONIC + #if defined(CLOCK_MONOTONIC) + #define BOOST_THREAD_HAS_MONO_CLOCK + #define BOOST_THREAD_INTERNAL_CLOCK_IS_MONO + #endif +#endif + +#if defined(BOOST_THREAD_PLATFORM_WIN32) +#elif ! defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO +#if defined BOOST_PTHREAD_HAS_TIMEDLOCK +#define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK +#elif (defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS-0)>=200112L) \ + || (defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__ >= 21) +#define BOOST_THREAD_USES_PTHREAD_TIMEDLOCK +#endif +#endif + // provided for backwards compatibility, since this // macro was used for several releases by mistake. -#if defined(BOOST_THREAD_DYN_DLL) && ! defined BOOST_THREAD_DYN_LINK +#if defined(BOOST_THREAD_DYN_DLL) && ! defined(BOOST_THREAD_DYN_LINK) # define BOOST_THREAD_DYN_LINK #endif // compatibility with the rest of Boost's auto-linking code: #if defined(BOOST_THREAD_DYN_LINK) || defined(BOOST_ALL_DYN_LINK) @@ -443,10 +494,10 @@ #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_THREAD_NO_LIB) && !defined(BOOST_THREAD_BUILD_DLL) && !defined(BOOST_THREAD_BUILD_LIB) // // Tell the autolink to link dynamically, this will get undef'ed by auto_link.hpp // once it's done with it: // -#if defined(BOOST_THREAD_USE_DLL) +#if defined(BOOST_THREAD_USE_DLL) & ! defined(BOOST_DYN_LINK) # define BOOST_DYN_LINK #endif // // Set the name of our library, this will get undef'ed by auto_link.hpp // once it's done with it: