BVB Source Codes

mars Show assert.hpp Source code

Return Download mars: download assert.hpp Source code - Download mars Source code - Type:.hpp
  1. //
  2. //  boost/assert.hpp - BOOST_ASSERT(expr)
  3. //                     BOOST_ASSERT_MSG(expr, msg)
  4. //                     BOOST_VERIFY(expr)
  5. //                     BOOST_VERIFY_MSG(expr, msg)
  6. //                     BOOST_ASSERT_IS_VOID
  7. //
  8. //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
  9. //  Copyright (c) 2007, 2014 Peter Dimov
  10. //  Copyright (c) Beman Dawes 2011
  11. //  Copyright (c) 2015 Ion Gaztanaga
  12. //
  13. //  Distributed under the Boost Software License, Version 1.0.
  14. //  See accompanying file LICENSE_1_0.txt or copy at
  15. //  http://www.boost.org/LICENSE_1_0.txt
  16. //
  17. //  Note: There are no include guards. This is intentional.
  18. //
  19. //  See http://www.boost.org/libs/assert/assert.html for documentation.
  20. //
  21.  
  22. //
  23. // Stop inspect complaining about use of 'assert':
  24. //
  25. // boostinspect:naassert_macro
  26. //
  27.  
  28. //
  29. // BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
  30. //
  31.  
  32. #undef BOOST_ASSERT
  33. #undef BOOST_ASSERT_MSG
  34. #undef BOOST_ASSERT_IS_VOID
  35.  
  36. #if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
  37.  
  38. # define BOOST_ASSERT(expr) ((void)0)
  39. # define BOOST_ASSERT_MSG(expr, msg) ((void)0)
  40. # define BOOST_ASSERT_IS_VOID
  41.  
  42. #elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
  43.  
  44. #include <boost/config.hpp> // for BOOST_LIKELY
  45. #include <boost/current_function.hpp>
  46.  
  47. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
  48. {
  49.     void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
  50.     void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
  51. } // namespace mars_boost
  52.  
  53. #define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::mars_boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
  54. #define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::mars_boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
  55.  
  56. #else
  57.  
  58. # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
  59.  
  60. # define BOOST_ASSERT(expr) assert(expr)
  61. # define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
  62. #if defined(NDEBUG)
  63. # define BOOST_ASSERT_IS_VOID
  64. #endif
  65.  
  66. #endif
  67.  
  68. //
  69. // BOOST_VERIFY, BOOST_VERIFY_MSG
  70. //
  71.  
  72. #undef BOOST_VERIFY
  73. #undef BOOST_VERIFY_MSG
  74.  
  75. #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
  76.  
  77. # define BOOST_VERIFY(expr) ((void)(expr))
  78. # define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))
  79.  
  80. #else
  81.  
  82. # define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
  83. # define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)
  84.  
  85. #endif
  86.  
downloadassert.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top