blob: 7b793a61b23d71fb737da2883148c9c8bba345dc [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (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 Thompson3d613fd2013-10-15 15:39:04 -07007#ifndef NDNBOOST_CONFIG_REQUIRES_THREADS_HPP
8#define NDNBOOST_CONFIG_REQUIRES_THREADS_HPP
Jeff Thompsonf7d49942013-08-01 16:47:40 -07009
Jeff Thompson3d613fd2013-10-15 15:39:04 -070010#ifndef NDNBOOST_CONFIG_HPP
Jeff Thompson2277ce52013-08-01 17:34:11 -070011# include <ndnboost/config.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070012#endif
13
Jeff Thompson3d613fd2013-10-15 15:39:04 -070014#if defined(NDNBOOST_DISABLE_THREADS)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070015
16//
17// special case to handle versions of gcc which don't currently support threads:
18//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070019#if defined(__GNUC__) && ((__GNUC__ < 3) || (__GNUC_MINOR__ <= 3) || !defined(NDNBOOST_STRICT_CONFIG))
Jeff Thompsonf7d49942013-08-01 16:47:40 -070020//
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 Thompson3d613fd2013-10-15 15:39:04 -070029# error "Threading support unavaliable: it has been explicitly disabled with NDNBOOST_DISABLE_THREADS"
Jeff Thompsonf7d49942013-08-01 16:47:40 -070030
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031#elif !defined(NDNBOOST_HAS_THREADS)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070032
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 Thompson3d613fd2013-10-15 15:39:04 -070090#endif // NDNBOOST_HAS_THREADS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070091
Jeff Thompson3d613fd2013-10-15 15:39:04 -070092#endif // NDNBOOST_CONFIG_REQUIRES_THREADS_HPP