fix doc example typo
[boost.git] / boost / thread / detail / platform.hpp
blob4a37cf389b88ba3547025f4ce61a0d7da51abcc2
1 // Copyright 2006 Roland Schwarz.
2 // (C) Copyright 2007 Anthony Williams
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // This work is a reimplementation along the design and ideas
8 // of William E. Kempf.
10 #ifndef BOOST_THREAD_RS06040501_HPP
11 #define BOOST_THREAD_RS06040501_HPP
13 // fetch compiler and platform configuration
14 #include <boost/config.hpp>
16 // insist on threading support being available:
17 #include <boost/config/requires_threads.hpp>
19 // choose platform
20 #if defined(linux) || defined(__linux) || defined(__linux__)
21 # define BOOST_THREAD_LINUX
22 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
23 # define BOOST_THREAD_BSD
24 #elif defined(sun) || defined(__sun)
25 # define BOOST_THREAD_SOLARIS
26 #elif defined(__sgi)
27 # define BOOST_THREAD_IRIX
28 #elif defined(__hpux)
29 # define BOOST_THREAD_HPUX
30 #elif defined(__CYGWIN__)
31 # define BOOST_THREAD_CYGWIN
32 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
33 # define BOOST_THREAD_WIN32
34 #elif defined(__BEOS__)
35 # define BOOST_THREAD_BEOS
36 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
37 # define BOOST_THREAD_MACOS
38 #elif defined(__IBMCPP__) || defined(_AIX)
39 # define BOOST_THREAD_AIX
40 #elif defined(__amigaos__)
41 # define BOOST_THREAD_AMIGAOS
42 #elif defined(__QNXNTO__)
43 # define BOOST_THREAD_QNXNTO
44 #elif defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
45 # if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_THREAD_POSIX)
46 # define BOOST_THREAD_POSIX
47 # endif
48 #endif
50 // For every supported platform add a new entry into the dispatch table below.
51 // BOOST_THREAD_POSIX is tested first, so on platforms where posix and native
52 // threading is available, the user may choose, by defining BOOST_THREAD_POSIX
53 // in her source. If a platform is known to support pthreads and no native
54 // port of boost_thread is available just specify "pthread" in the
55 // dispatcher table. If there is no entry for a platform but pthreads is
56 // available on the platform, pthread is choosen as default. If nothing is
57 // available the preprocessor will fail with a diagnostic message.
59 #if defined(BOOST_THREAD_POSIX)
60 # define BOOST_THREAD_PLATFORM_PTHREAD
61 #else
62 # if defined(BOOST_THREAD_WIN32)
63 # define BOOST_THREAD_PLATFORM_WIN32
64 # elif defined(BOOST_HAS_PTHREADS)
65 # define BOOST_THREAD_PLATFORM_PTHREAD
66 # else
67 # error "Sorry, no boost threads are available for this platform."
68 # endif
69 #endif
71 #endif // BOOST_THREAD_RS06040501_HPP