summaryrefslogtreecommitdiff
path: root/boost/units/config.hpp
blob: 9e8a74f3bdb3d900c4ab09b9f996527f40cb58b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Boost.Units - A C++ library for zero-overhead dimensional analysis and 
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_UNITS_CONFIG_HPP
#define BOOST_UNITS_CONFIG_HPP

#include <boost/config.hpp>
#include <boost/version.hpp>

#ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
    #if (BOOST_VERSION >= 103400)
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_BOOST_TYPEOF    1
    #else
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_BOOST_TYPEOF    0
    #endif
#endif 

#if (BOOST_UNITS_HAS_BOOST_TYPEOF)
    #include <boost/typeof/typeof.hpp> 
    ///INTERNAL ONLY
    #define BOOST_UNITS_HAS_TYPEOF          1
#else    
    #if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_TYPEOF          1
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_GNU_TYPEOF      1
    #elif defined(__MWERKS__)
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_TYPEOF          1
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_MWERKS_TYPEOF   1
    #else
        ///INTERNAL ONLY
        #define BOOST_UNITS_HAS_TYPEOF          0
    #endif
#endif

// uncomment this to test without typeof support at all
//#undef BOOST_UNITS_HAS_TYPEOF
//#define BOOST_UNITS_HAS_TYPEOF          0

#ifndef BOOST_UNITS_NO_COMPILER_CHECK

    #ifdef BOOST_NO_MEMBER_TEMPLATES
        #error Boost.Units requires member template
    #endif

    #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
        #error Boost.Units requires member template keyword
    #endif

    #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
        #error Boost.Units requires in class member initialization
    #endif

    #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
        #error Boost.Units requires function template partial ordering
    #endif

    #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
        #error Boost.Units requires explicit function template arguments
    #endif

    #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
        #error Boost.Units requires partial specialization
    #endif

#endif

#ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
    ///INTERNAL ONLY
    #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
#else
    ///INTERNAL ONLY
    #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
#endif

#ifdef BOOST_UNITS_DOXYGEN

/// If defined will trigger a static assertion if quantity<Unit, T>
/// is not layout compatible with T
#define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY

/// If defined will disable a preprocessor check that the
/// compiler is able to handle the library.
#define BOOST_UNITS_NO_COMPILER_CHECK

/// Enable checking to verify that a homogeneous system
/// is actually capable of representing all the dimensions
/// that it is used with.  Off by default.
#define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS

#endif

#endif