config.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #ifndef BOOST_UNITS_CONFIG_HPP
  11. #define BOOST_UNITS_CONFIG_HPP
  12. #include <boost/config.hpp>
  13. #include <boost/version.hpp>
  14. #ifndef BOOST_UNITS_HAS_BOOST_TYPEOF
  15. #if (BOOST_VERSION >= 103400)
  16. ///INTERNAL ONLY
  17. #define BOOST_UNITS_HAS_BOOST_TYPEOF 1
  18. #else
  19. ///INTERNAL ONLY
  20. #define BOOST_UNITS_HAS_BOOST_TYPEOF 0
  21. #endif
  22. #endif
  23. #if (BOOST_UNITS_HAS_BOOST_TYPEOF)
  24. #include <boost/typeof/typeof.hpp>
  25. ///INTERNAL ONLY
  26. #define BOOST_UNITS_HAS_TYPEOF 1
  27. #else
  28. #if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
  29. ///INTERNAL ONLY
  30. #define BOOST_UNITS_HAS_TYPEOF 1
  31. ///INTERNAL ONLY
  32. #define BOOST_UNITS_HAS_GNU_TYPEOF 1
  33. #elif defined(__MWERKS__)
  34. ///INTERNAL ONLY
  35. #define BOOST_UNITS_HAS_TYPEOF 1
  36. ///INTERNAL ONLY
  37. #define BOOST_UNITS_HAS_MWERKS_TYPEOF 1
  38. #else
  39. ///INTERNAL ONLY
  40. #define BOOST_UNITS_HAS_TYPEOF 0
  41. #endif
  42. #endif
  43. // uncomment this to test without typeof support at all
  44. //#undef BOOST_UNITS_HAS_TYPEOF
  45. //#define BOOST_UNITS_HAS_TYPEOF 0
  46. #ifndef BOOST_UNITS_NO_COMPILER_CHECK
  47. #ifdef BOOST_NO_MEMBER_TEMPLATES
  48. #error Boost.Units requires member template
  49. #endif
  50. #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
  51. #error Boost.Units requires member template keyword
  52. #endif
  53. #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
  54. #error Boost.Units requires in class member initialization
  55. #endif
  56. #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
  57. #error Boost.Units requires function template partial ordering
  58. #endif
  59. #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
  60. #error Boost.Units requires explicit function template arguments
  61. #endif
  62. #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  63. #error Boost.Units requires partial specialization
  64. #endif
  65. #endif
  66. #ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
  67. ///INTERNAL ONLY
  68. #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
  69. #else
  70. ///INTERNAL ONLY
  71. #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0)
  72. #endif
  73. #ifdef BOOST_UNITS_DOXYGEN
  74. /// If defined will trigger a static assertion if quantity<Unit, T>
  75. /// is not layout compatible with T
  76. #define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
  77. /// If defined will diasable a preprocessor check that the
  78. /// compiler is able to handle the library.
  79. #define BOOST_UNITS_NO_COMPILER_CHECK
  80. /// Enable checking to verify that a homogeneous system
  81. /// is actually capable of representing all the dimensions
  82. /// that it is used with. Off by default.
  83. #define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
  84. #endif
  85. #endif