blob: c95d963a414340ced23076d59851eab8baa82513 [file] [log] [blame]
Brian Silverman9d8fa392018-08-04 17:09:24 -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// See http://www.boost.org/libs/config for the most recent version.
7
8#ifndef BOOST_LINK_TEST_HPP
9#define BOOST_LINK_TEST_HPP
10
11#include <boost/config.hpp>
12
13//
14// set up code to determine our compilers options,
15// we will check that these are the same in the
16// .exe and the .dll:
17//
18#ifdef BOOST_DYN_LINK
19static const bool dyn_link = true;
20#else
21static const bool dyn_link = false;
22#endif
23#if defined(_DLL) || defined(_RTLDLL)
24static const bool dyn_rtl = true;
25#else
26static const bool dyn_rtl = false;
27#endif
28#if defined(BOOST_HAS_THREADS)
29static const bool has_threads = true;
30#else
31static const bool has_threads = false;
32#endif
33#if defined(_DEBUG)
34static const bool debug = true;
35#else
36static const bool debug = false;
37#endif
38#if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
39static const bool stl_debug = true;
40#else
41static const bool stl_debug = false;
42#endif
43
44//
45// set up import and export options:
46//
47#if defined(BOOST_DYN_LINK)
48# ifdef BOOST_CONFIG_SOURCE
49# define BOOST_CONFIG_DECL BOOST_SYMBOL_EXPORT
50# else
51# define BOOST_CONFIG_DECL BOOST_SYMBOL_IMPORT
52# endif
53#endif
54#ifndef BOOST_CONFIG_DECL
55# define BOOST_CONFIG_DECL
56#endif
57
58//
59// define our entry point:
60//
61bool BOOST_CONFIG_DECL check_options(
62 bool m_dyn_link,
63 bool m_dyn_rtl,
64 bool m_has_threads,
65 bool m_debug,
66 bool m_stlp_debug);
67
68//
69// set up automatic linking:
70//
71#if !defined(BOOST_CONFIG_SOURCE) && !defined(BOOST_CONFIG_NO_LIB)
72# define BOOST_LIB_NAME link_test
73# include <boost/config/auto_link.hpp>
74#endif
75
76#ifndef BOOST_NO_CXX11_EXTERN_TEMPLATE
77
78template <class T>
79T test_free_proc(T v)
80{
81 return v;
82}
83
84template <class T>
85struct tester
86{
87 static int test();
88};
89
90template <class T>
91int tester<T>::test()
92{
93 return 0;
94}
95
96#ifdef BOOST_CONFIG_SOURCE
97template BOOST_SYMBOL_EXPORT int test_free_proc<int>(int);
98template BOOST_SYMBOL_EXPORT int tester<int>::test();
99#else
100extern template BOOST_SYMBOL_IMPORT int test_free_proc<int>(int);
101extern template BOOST_SYMBOL_IMPORT int tester<int>::test();
102#endif
103
104#endif // BOOST_NO_CXX11_EXTERN_TEMPLATE
105
106#endif // BOOST_LINK_TEST_HPP
107
108