Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | // (C) Copyright John Maddock 2003. |
| 2 | // Use, modification and distribution are subject to the |
| 3 | // Boost Software License, Version 1.0. (See accompanying file |
| 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 7 | #ifndef NDNBOOST_CONFIG_REQUIRES_THREADS_HPP |
| 8 | #define NDNBOOST_CONFIG_REQUIRES_THREADS_HPP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 9 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 10 | #ifndef NDNBOOST_CONFIG_HPP |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 11 | # include <ndnboost/config.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 12 | #endif |
| 13 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 14 | #if defined(NDNBOOST_DISABLE_THREADS) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 15 | |
| 16 | // |
| 17 | // special case to handle versions of gcc which don't currently support threads: |
| 18 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 19 | #if defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC_MINOR__ <= 3) || !defined(NDNBOOST_STRICT_CONFIG)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 20 | // |
| 21 | // this is checked up to gcc 3.3: |
| 22 | // |
| 23 | #if defined(__sgi) || defined(__hpux) |
| 24 | # error "Multi-threaded programs are not supported by gcc on HPUX or Irix (last checked with gcc 3.3)" |
| 25 | #endif |
| 26 | |
| 27 | #endif |
| 28 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | # error "Threading support unavaliable: it has been explicitly disabled with NDNBOOST_DISABLE_THREADS" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 30 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 31 | #elif !defined(NDNBOOST_HAS_THREADS) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 32 | |
| 33 | # if defined __COMO__ |
| 34 | // Comeau C++ |
| 35 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_MT (Windows) or -D_REENTRANT (Unix)" |
| 36 | |
| 37 | #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) |
| 38 | // Intel |
| 39 | #ifdef _WIN32 |
| 40 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd" |
| 41 | #else |
| 42 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -openmp" |
| 43 | #endif |
| 44 | |
| 45 | # elif defined __GNUC__ |
| 46 | // GNU C++: |
| 47 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" |
| 48 | |
| 49 | #elif defined __sgi |
| 50 | // SGI MIPSpro C++ |
| 51 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_SGI_MP_SOURCE" |
| 52 | |
| 53 | #elif defined __DECCXX |
| 54 | // Compaq Tru64 Unix cxx |
| 55 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread" |
| 56 | |
| 57 | #elif defined __BORLANDC__ |
| 58 | // Borland |
| 59 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -tWM" |
| 60 | |
| 61 | #elif defined __MWERKS__ |
| 62 | // Metrowerks CodeWarrior |
| 63 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either -runtime sm, -runtime smd, -runtime dm, or -runtime dmd" |
| 64 | |
| 65 | #elif defined __SUNPRO_CC |
| 66 | // Sun Workshop Compiler C++ |
| 67 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt" |
| 68 | |
| 69 | #elif defined __HP_aCC |
| 70 | // HP aCC |
| 71 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt" |
| 72 | |
| 73 | #elif defined(__IBMCPP__) |
| 74 | // IBM Visual Age |
| 75 | # error "Compiler threading support is not turned on. Please compile the code with the xlC_r compiler" |
| 76 | |
| 77 | #elif defined _MSC_VER |
| 78 | // Microsoft Visual C++ |
| 79 | // |
| 80 | // Must remain the last #elif since some other vendors (Metrowerks, for |
| 81 | // example) also #define _MSC_VER |
| 82 | # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd" |
| 83 | |
| 84 | #else |
| 85 | |
| 86 | # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use" |
| 87 | |
| 88 | #endif // compilers |
| 89 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 90 | #endif // NDNBOOST_HAS_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 91 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 92 | #endif // NDNBOOST_CONFIG_REQUIRES_THREADS_HPP |