Chris@16: // Copyright 2006 Roland Schwarz. Chris@16: // (C) Copyright 2007 Anthony Williams Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // This work is a reimplementation along the design and ideas Chris@16: // of William E. Kempf. Chris@16: Chris@16: #ifndef BOOST_THREAD_RS06040501_HPP Chris@16: #define BOOST_THREAD_RS06040501_HPP Chris@16: Chris@16: // fetch compiler and platform configuration Chris@16: #include Chris@16: Chris@16: // insist on threading support being available: Chris@16: #include Chris@16: Chris@16: // choose platform Chris@16: #if defined(linux) || defined(__linux) || defined(__linux__) Chris@16: # define BOOST_THREAD_LINUX Chris@16: //# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(100000) Chris@16: #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) Chris@16: # define BOOST_THREAD_BSD Chris@16: #elif defined(sun) || defined(__sun) Chris@16: # define BOOST_THREAD_SOLARIS Chris@16: #elif defined(__sgi) Chris@16: # define BOOST_THREAD_IRIX Chris@16: #elif defined(__hpux) Chris@16: # define BOOST_THREAD_HPUX Chris@16: #elif defined(__CYGWIN__) Chris@16: # define BOOST_THREAD_CYGWIN Chris@16: #elif (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(BOOST_DISABLE_WIN32) Chris@16: # define BOOST_THREAD_WIN32 Chris@16: #elif defined(__BEOS__) Chris@16: # define BOOST_THREAD_BEOS Chris@16: #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) Chris@16: # define BOOST_THREAD_MACOS Chris@16: //# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(1000) Chris@16: #elif defined(__IBMCPP__) || defined(_AIX) Chris@16: # define BOOST_THREAD_AIX Chris@16: #elif defined(__amigaos__) Chris@16: # define BOOST_THREAD_AMIGAOS Chris@16: #elif defined(__QNXNTO__) Chris@16: # define BOOST_THREAD_QNXNTO Chris@16: #elif defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) Chris@16: # if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_THREAD_POSIX) Chris@16: # define BOOST_THREAD_POSIX Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: // For every supported platform add a new entry into the dispatch table below. Chris@16: // BOOST_THREAD_POSIX is tested first, so on platforms where posix and native Chris@16: // threading is available, the user may choose, by defining BOOST_THREAD_POSIX Chris@16: // in her source. If a platform is known to support pthreads and no native Chris@16: // port of boost_thread is available just specify "pthread" in the Chris@16: // dispatcher table. If there is no entry for a platform but pthreads is Chris@16: // available on the platform, pthread is choosen as default. If nothing is Chris@16: // available the preprocessor will fail with a diagnostic message. Chris@16: Chris@16: #if defined(BOOST_THREAD_POSIX) Chris@16: # define BOOST_THREAD_PLATFORM_PTHREAD Chris@16: #else Chris@16: # if defined(BOOST_THREAD_WIN32) Chris@16: # define BOOST_THREAD_PLATFORM_WIN32 Chris@16: # elif defined(BOOST_HAS_PTHREADS) Chris@16: # define BOOST_THREAD_PLATFORM_PTHREAD Chris@16: # else Chris@16: # error "Sorry, no boost threads are available for this platform." Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: #endif // BOOST_THREAD_RS06040501_HPP