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)
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
73 #ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
75 #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
78 #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
81 #ifdef BOOST_UNITS_DOXYGEN
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
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
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