boost_interprocess_check.hpp 1.1 KB

123456789101112131415161718192021222324252627
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2004-2012. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_INTERPROCESS_TEST_CHECK_HEADER
  11. #define BOOST_INTERPROCESS_TEST_CHECK_HEADER
  12. #include <boost/interprocess/detail/config_begin.hpp>
  13. #include <boost/interprocess/exceptions.hpp>
  14. #include <iostream>
  15. namespace boost { namespace interprocess { namespace test {
  16. #define BOOST_INTERPROCESS_CHECK( P ) \
  17. if(!(P)) do{ assert(P); std::cout << "Failed: " << #P << " file: " << __FILE__ << " line : " << __LINE__ << std::endl; throw boost::interprocess::interprocess_exception(#P);}while(0)
  18. }}} //namespace boost { namespace interprocess { namespace test {
  19. #include <boost/interprocess/detail/config_end.hpp>
  20. #endif //BOOST_INTERPROCESS_TEST_CHECK_HEADER