Extended and added thread support macros

[SVN r11197]
This commit is contained in:
John Maddock
2001-09-22 11:50:15 +00:00
parent 7b7eeadafa
commit 88e49f6808
3 changed files with 51 additions and 0 deletions

View File

@ -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__)
// //

View File

@ -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

View File

@ -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