Aldebaran documentation
|
C++ Libraries
|
index
libqi-api
release-2.5.3-2016-11-18
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
qi
assert.hpp
Go to the documentation of this file.
1
#pragma once
2
/*
3
** Copyright (C) 2016 Aldebaran Robotics
4
** See COPYING for the license
5
*/
6
7
#ifndef _QI_ASSERT_HPP_
8
#define _QI_ASSERT_HPP_
9
10
11
#include <boost/predef/compiler.h>
12
13
/* TODO:
14
- add assertion variants (assert_if);
15
- add a way to force assert activation whatever the build mode;
16
- add a way to chose assertion behaviour at compile time (not necessarilly abort);
17
- add a way to force assertion behaviour whatever the platform;
18
*/
19
# if defined(NDEBUG)
20
# define QI_ASSERT(expr__)
21
# else
22
# if BOOST_COMP_MSVC
23
# include <cstdlib>
24
# define QI_ASSERT( expr__ ) { if( !( expr__ ) ){ __debugbreak(); ::std::abort(); } }
25
# else
26
# include <cassert>
27
# define QI_ASSERT( expr__ ) assert( expr__ )
28
# endif
29
# endif
30
31
# define QI_ASSERT_TRUE( expr__ ) QI_ASSERT( expr__ )
32
# define QI_ASSERT_FALSE( expr__ ) QI_ASSERT( !(expr__) )
33
34
#endif // _QI_ASSERT_HPP_
Copyright Aldebaran Robotics