condition.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Boost.Geometry
  2. // Copyright (c) 2015 Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_UTIL_CONDITION_HPP
  8. #define BOOST_GEOMETRY_UTIL_CONDITION_HPP
  9. #include <boost/config.hpp>
  10. // The macro defined in this file allows to suppress the MSVC
  11. // compiler warning C4127: conditional expression is constant
  12. #ifdef BOOST_MSVC
  13. // NOTE: The code commented out below contains an alternative implementation
  14. // of a macro using a free function. It was left here in case if in the future
  15. // version of MSVC for the code currently used in the macro implementation
  16. // the warning was generated.
  17. //#ifndef DOXYGEN_NO_DETAIL
  18. //namespace boost { namespace geometry { namespace detail {
  19. //BOOST_FORCEINLINE bool condition(bool const b) { return b; }
  20. //}}} // boost::geometry::detail
  21. //#endif // DOXYGEN_NO_DETAIL
  22. //#define BOOST_GEOMETRY_CONDITION(CONDITION) boost::geometry::detail::condition(CONDITION)
  23. #define BOOST_GEOMETRY_CONDITION(CONDITION) ((void)0, (CONDITION))
  24. #else
  25. #define BOOST_GEOMETRY_CONDITION(CONDITION) (CONDITION)
  26. #endif
  27. #endif // BOOST_GEOMETRY_UTIL_CONDITION_HPP