diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index cb3c9cfd..73d8bba6 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -36,6 +36,13 @@ # define BOOST_NO_INTRINSIC_WCHAR_T #endif +// +// Threading support: +// Turn this on unconditionally here, it will get turned off again later +// if no threading API is detected. +// +#define BOOST_HAS_THREADS + #define BOOST_COMPILER "GNU C++ version " BOOST_STRINGIZE(__GNUC__) "." BOOST_STRINGIZE(__GNUC_MINOR__) // diff --git a/include/boost/config/platform/cygwin.hpp b/include/boost/config/platform/cygwin.hpp index 9ba1b629..b5749511 100644 --- a/include/boost/config/platform/cygwin.hpp +++ b/include/boost/config/platform/cygwin.hpp @@ -12,5 +12,17 @@ #define BOOST_NO_CWCHAR #define BOOST_NO_SWPRINTF +// +// Threading API: +// See if we have POSIX threads, if we do use them, otherwise +// revert to native Win threads. +#include +#if if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) +# define BOOST_HAS_PTHREADS +# define BOOST_HAS_SCHED_YIELD +#else +# define NOOST_HAS_WINTHREADS +#endif + diff --git a/include/boost/config/posix_features.hpp b/include/boost/config/posix_features.hpp index 7a4a4591..fc4271b4 100644 --- a/include/boost/config/posix_features.hpp +++ b/include/boost/config/posix_features.hpp @@ -30,4 +30,36 @@ # define BOOST_HAS_PTHREADS # endif + // BOOST_HAS_NANOSLEEP: + // This is predicated on _POSIX_TIMERS: +# if defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0) +# define BOOST_HAS_NANOSLEEP +# endif + + // BOOST_HAS_SCHED_YIELD: + // This is predicated on _POSIX_PRIORITY_SCHEDULING or + // on _POSIX_THREAD_PRIORITY_SCHEDULING. +# if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0) +# define BOOST_HAS_SCHED_YIELD +# endif +# if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0) +# define BOOST_HAS_SCHED_YIELD +# endif + + // BOOST_HAS_GETTIMEOFDAY: + // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE: + // These are predicated on _XOPEN_VERSION, and appears to be first released + // in issue 4, version 2 (_XOPEN_VERSION > 500). +# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 > 500) +# define BOOST_HAS_GETTIMEOFDAY +# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE +# endif + + // BOOST_HAS_CLOCK_GETTIME: + // This is predicated on _POSIX_TIMERS. +# if defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 > 0) +# define BOOST_HAS_CLOCK_GETTIME +# endif + + # endif