config.hpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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)
  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. #endif
  60. #ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
  61. ///INTERNAL ONLY
  62. #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b)))
  63. #else
  64. ///INTERNAL ONLY
  65. #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b)
  66. #endif
  67. #ifdef BOOST_UNITS_DOXYGEN
  68. /// If defined will trigger a static assertion if quantity<Unit, T>
  69. /// is not layout compatible with T
  70. #define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY
  71. /// If defined will disable a preprocessor check that the
  72. /// compiler is able to handle the library.
  73. #define BOOST_UNITS_NO_COMPILER_CHECK
  74. /// Enable checking to verify that a homogeneous system
  75. /// is actually capable of representing all the dimensions
  76. /// that it is used with. Off by default.
  77. #define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS
  78. #endif
  79. #endif