source: NonGTP/Boost/boost/thread/detail/config.hpp @ 857

Revision 857, 2.9 KB checked in by igarcia, 18 years ago (diff)
Line 
1// Copyright (C) 2001-2003
2// William E. Kempf
3//
4// Permission to use, copy, modify, distribute and sell this software
5// and its documentation for any purpose is hereby granted without fee,
6// provided that the above copyright notice appear in all copies and
7// that both that copyright notice and this permission notice appear
8// in supporting documentation.  William E. Kempf makes no representations
9// about the suitability of this software for any purpose.
10// It is provided "as is" without express or implied warranty.
11
12#ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
13#define BOOST_THREAD_CONFIG_WEK01032003_HPP
14
15#include <boost/config.hpp>
16
17// insist on threading support being available:
18#include <boost/config/requires_threads.hpp>
19
20#if defined(BOOST_THREAD_BUILD_DLL)   //Build dll
21#elif defined(BOOST_THREAD_BUILD_LIB) //Build lib
22#elif defined(BOOST_THREAD_USE_DLL)   //Use dll
23#elif defined(BOOST_THREAD_USE_LIB)   //Use lib
24#else //Use default
25#   if defined(BOOST_HAS_WINTHREADS)
26#       if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
27            //For compilers supporting auto-tss cleanup
28            //with Boost.Threads lib, use Boost.Threads lib
29#           define BOOST_THREAD_USE_LIB
30#       else
31            //For compilers not yet supporting auto-tss cleanup
32            //with Boost.Threads lib, use Boost.Threads dll
33#           define BOOST_THREAD_USE_DLL
34#       endif
35#   else
36#       define BOOST_THREAD_USE_LIB
37#   endif
38#endif
39
40#if defined(BOOST_HAS_DECLSPEC)
41#   if defined(BOOST_THREAD_BUILD_DLL) //Build dll
42#       define BOOST_THREAD_DECL __declspec(dllexport)
43#   elif defined(BOOST_THREAD_USE_DLL) //Use dll
44#       define BOOST_THREAD_DECL __declspec(dllimport)
45#   else
46#       define BOOST_THREAD_DECL
47#   endif
48#else
49#   define BOOST_THREAD_DECL
50#endif // BOOST_HAS_DECLSPEC
51
52//
53// Automatically link to the correct build variant where possible.
54//
55#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_THREAD_NO_LIB) && !defined(BOOST_THREAD_BUILD_DLL) && !defined(BOOST_THREAD_BUILD_LIB)
56//
57// Tell the autolink to link dynamically, this will get undef'ed by auto_link.hpp
58// once it's done with it:
59//
60#if defined(BOOST_THREAD_USE_DLL)
61#   define BOOST_DYN_LINK
62#endif
63//
64// Set the name of our library, this will get undef'ed by auto_link.hpp
65// once it's done with it:
66//
67#if defined(BOOST_THREAD_LIB_NAME)
68#    define BOOST_LIB_NAME BOOST_THREAD_LIB_NAME
69#else
70#    define BOOST_LIB_NAME boost_thread
71#endif
72//
73// If we're importing code from a dll, then tell auto_link.hpp about it:
74//
75// And include the header that does the work:
76//
77#include <boost/config/auto_link.hpp>
78#endif  // auto-linking disabled
79
80#endif // BOOST_THREAD_CONFIG_WEK1032003_HPP
81
82// Change Log:
83//   22 Jan 05 Roland Schwarz (speedsnail)
84//      Usage of BOOST_HAS_DECLSPEC macro.
85//      Default again is static lib usage.
86//      BOOST_DYN_LINK only defined when autolink included.
Note: See TracBrowser for help on using the repository browser.