forked from boostorg/config
Extended and added thread support macros
[SVN r11197]
This commit is contained in:
@ -36,6 +36,13 @@
|
|||||||
# define BOOST_NO_INTRINSIC_WCHAR_T
|
# define BOOST_NO_INTRINSIC_WCHAR_T
|
||||||
#endif
|
#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__)
|
#define BOOST_COMPILER "GNU C++ version " BOOST_STRINGIZE(__GNUC__) "." BOOST_STRINGIZE(__GNUC_MINOR__)
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -12,5 +12,17 @@
|
|||||||
#define BOOST_NO_CWCHAR
|
#define BOOST_NO_CWCHAR
|
||||||
#define BOOST_NO_SWPRINTF
|
#define BOOST_NO_SWPRINTF
|
||||||
|
|
||||||
|
//
|
||||||
|
// Threading API:
|
||||||
|
// See if we have POSIX threads, if we do use them, otherwise
|
||||||
|
// revert to native Win threads.
|
||||||
|
#include <unistd.h>
|
||||||
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,4 +30,36 @@
|
|||||||
# define BOOST_HAS_PTHREADS
|
# define BOOST_HAS_PTHREADS
|
||||||
# endif
|
# 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
|
# endif
|
||||||
|
Reference in New Issue
Block a user