1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
3 //
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 
11 #ifndef BOOST_UNITS_CONFIG_HPP
12 #define BOOST_UNITS_CONFIG_HPP
13 
14 #include <boost/config.hpp>
15 #include <boost/version.hpp>
16 
17 #ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
18     #if (BOOST_VERSION >= 103400)
19         ///INTERNAL ONLY
20         #define BOOST_UNITS_HAS_BOOST_TYPEOF    1
21     #else
22         ///INTERNAL ONLY
23         #define BOOST_UNITS_HAS_BOOST_TYPEOF    0
24     #endif
25 #endif
26 
27 #if (BOOST_UNITS_HAS_BOOST_TYPEOF)
28     #include <boost/typeof/typeof.hpp>
29     ///INTERNAL ONLY
30     #define BOOST_UNITS_HAS_TYPEOF          1
31 #else
32     #if (__GNUC__ && __cplusplus)
33         ///INTERNAL ONLY
34         #define BOOST_UNITS_HAS_TYPEOF          1
35         ///INTERNAL ONLY
36         #define BOOST_UNITS_HAS_GNU_TYPEOF      1
37     #elif defined(__MWERKS__)
38         ///INTERNAL ONLY
39         #define BOOST_UNITS_HAS_TYPEOF          1
40         ///INTERNAL ONLY
41         #define BOOST_UNITS_HAS_MWERKS_TYPEOF   1
42     #else
43         ///INTERNAL ONLY
44         #define BOOST_UNITS_HAS_TYPEOF          0
45     #endif
46 #endif
47 
48 // uncomment this to test without typeof support at all
49 //#undef BOOST_UNITS_HAS_TYPEOF
50 //#define BOOST_UNITS_HAS_TYPEOF          0
51 
52 #ifndef BOOST_UNITS_NO_COMPILER_CHECK
53 
54     #ifdef BOOST_NO_MEMBER_TEMPLATES
55         #error Boost.Units requires member template
56     #endif
57 
58     #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
59         #error Boost.Units requires member template keyword
60     #endif
61 
62     #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
63         #error Boost.Units requires in class member initialization
64     #endif
65 
66     #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
67         #error Boost.Units requires function template partial ordering
68     #endif
69 
70 
71 #endif
72 
73 #ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
74     ///INTERNAL ONLY
75     #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
76 #else
77     ///INTERNAL ONLY
78     #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b)
79 #endif
80 
81 #ifdef BOOST_UNITS_DOXYGEN
82 
83 /// If defined will trigger a static assertion if quantity<Unit, T>
84 /// is not layout compatible with T
85 #define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
86 
87 /// If defined will disable a preprocessor check that the
88 /// compiler is able to handle the library.
89 #define BOOST_UNITS_NO_COMPILER_CHECK
90 
91 /// Enable checking to verify that a homogeneous system
92 /// is actually capable of representing all the dimensions
93 /// that it is used with.  Off by default.
94 #define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
95 
96 #endif
97 
98 #endif
99