requires_threads.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #ifndef BOOST_CONFIG_REQUIRES_THREADS_HPP
  6. #define BOOST_CONFIG_REQUIRES_THREADS_HPP
  7. #ifndef BOOST_CONFIG_HPP
  8. # include <boost/config.hpp>
  9. #endif
  10. #if defined(BOOST_DISABLE_THREADS)
  11. //
  12. // special case to handle versions of gcc which don't currently support threads:
  13. //
  14. #if defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC_MINOR__ <= 3) || !defined(BOOST_STRICT_CONFIG))
  15. //
  16. // this is checked up to gcc 3.3:
  17. //
  18. #if defined(__sgi) || defined(__hpux)
  19. # error "Multi-threaded programs are not supported by gcc on HPUX or Irix (last checked with gcc 3.3)"
  20. #endif
  21. #endif
  22. # error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
  23. #elif !defined(BOOST_HAS_THREADS)
  24. # if defined __COMO__
  25. // Comeau C++
  26. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_MT (Windows) or -D_REENTRANT (Unix)"
  27. #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
  28. // Intel
  29. #ifdef _WIN32
  30. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
  31. #else
  32. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -openmp"
  33. #endif
  34. # elif defined __GNUC__
  35. // GNU C++:
  36. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
  37. #elif defined __sgi
  38. // SGI MIPSpro C++
  39. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -D_SGI_MP_SOURCE"
  40. #elif defined __DECCXX
  41. // Compaq Tru64 Unix cxx
  42. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread"
  43. #elif defined __BORLANDC__
  44. // Borland
  45. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -tWM"
  46. #elif defined __MWERKS__
  47. // Metrowerks CodeWarrior
  48. # 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"
  49. #elif defined __SUNPRO_CC
  50. // Sun Workshop Compiler C++
  51. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt"
  52. #elif defined __HP_aCC
  53. // HP aCC
  54. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: -mt"
  55. #elif defined(__IBMCPP__)
  56. // IBM Visual Age
  57. # error "Compiler threading support is not turned on. Please compile the code with the xlC_r compiler"
  58. #elif defined _MSC_VER
  59. // Microsoft Visual C++
  60. //
  61. // Must remain the last #elif since some other vendors (Metrowerks, for
  62. // example) also #define _MSC_VER
  63. # error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"
  64. #else
  65. # error "Compiler threading support is not turned on. Please consult your compiler's documentation for the appropriate options to use"
  66. #endif // compilers
  67. #endif // BOOST_HAS_THREADS
  68. #endif // BOOST_CONFIG_REQUIRES_THREADS_HPP