1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
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)
11 #ifndef BOOST_UNITS_CONFIG_HPP
12 #define BOOST_UNITS_CONFIG_HPP
14 #include <boost/config.hpp>
15 #include <boost/version.hpp>
17 #ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
18 #if (BOOST_VERSION >= 103400)
20 #define BOOST_UNITS_HAS_BOOST_TYPEOF 1
23 #define BOOST_UNITS_HAS_BOOST_TYPEOF 0
27 #if (BOOST_UNITS_HAS_BOOST_TYPEOF)
28 #include <boost/typeof/typeof.hpp>
30 #define BOOST_UNITS_HAS_TYPEOF 1
32 #if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
34 #define BOOST_UNITS_HAS_TYPEOF 1
36 #define BOOST_UNITS_HAS_GNU_TYPEOF 1
37 #elif defined(__MWERKS__)
39 #define BOOST_UNITS_HAS_TYPEOF 1
41 #define BOOST_UNITS_HAS_MWERKS_TYPEOF 1
44 #define BOOST_UNITS_HAS_TYPEOF 0
48 // uncomment this to test without typeof support at all
49 //#undef BOOST_UNITS_HAS_TYPEOF
50 //#define BOOST_UNITS_HAS_TYPEOF 0
52 #ifndef BOOST_UNITS_NO_COMPILER_CHECK
54 #ifdef BOOST_NO_MEMBER_TEMPLATES
55 #error Boost.Units requires member template
58 #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
59 #error Boost.Units requires member template keyword
62 #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
63 #error Boost.Units requires in class member initialization
66 #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
67 #error Boost.Units requires function template partial ordering
70 #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
71 #error Boost.Units requires explicit function template arguments
74 #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
75 #error Boost.Units requires partial specialization
80 #ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
82 #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
85 #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
88 #ifdef BOOST_UNITS_DOXYGEN
90 /// If defined will trigger a static assertion if quantity<Unit, T>
91 /// is not layout compatible with T
92 #define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
94 /// If defined will disable a preprocessor check that the
95 /// compiler is able to handle the library.
96 #define BOOST_UNITS_NO_COMPILER_CHECK
98 /// Enable checking to verify that a homogeneous system
99 /// is actually capable of representing all the dimensions
100 /// that it is used with. Off by default.
101 #define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS