assert.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 /*
3  * Copyright (c) 2008, Willow Garage, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of Willow Garage, Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 // Author: Josh Faust
32 
33 #ifndef ROSCONSOLE_ROSASSERT_H
34 #define ROSCONSOLE_ROSASSERT_H
35 
36 #include "ros/console.h"
37 #include "ros/static_assert.h"
38 
93 #include <ros/platform.h>
94 
95 #ifdef WIN32
96 # if defined (__MINGW32__)
97 # define ROS_ISSUE_BREAK() DebugBreak();
98 # else // MSVC
99 # define ROS_ISSUE_BREAK() __debugbreak();
100 # endif
101 #elif defined(__powerpc64__)
102 # define ROS_ISSUE_BREAK() asm volatile ("tw 31,1,1");
103 #elif defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
104 # define ROS_ISSUE_BREAK() asm("int $3");
105 #else
106 # include <stdlib.h>
107 # define ROS_ISSUE_BREAK() abort();
108 #endif
109 
110 #ifndef NDEBUG
111 #ifndef ROS_ASSERT_ENABLED
112 #define ROS_ASSERT_ENABLED
113 #endif
114 #endif
115 
116 #ifdef ROS_ASSERT_ENABLED
117 #define ROS_BREAK() \
118  do { \
119  ROS_FATAL("BREAKPOINT HIT\n\tfile = %s\n\tline=%d\n", __FILE__, __LINE__); \
120  ROS_ISSUE_BREAK() \
121  } while (0)
122 
123 #define ROS_ASSERT(cond) \
124  do { \
125  if (!(cond)) { \
126  ROS_FATAL("ASSERTION FAILED\n\tfile = %s\n\tline = %d\n\tcond = %s\n", __FILE__, __LINE__, #cond); \
127  ROS_ISSUE_BREAK() \
128  } \
129  } while (0)
130 
131 #define ROS_ASSERT_MSG(cond, ...) \
132  do { \
133  if (!(cond)) { \
134  ROS_FATAL("ASSERTION FAILED\n\tfile = %s\n\tline = %d\n\tcond = %s\n\tmessage = ", __FILE__, __LINE__, #cond); \
135  ROS_FATAL(__VA_ARGS__); \
136  ROS_FATAL("\n"); \
137  ROS_ISSUE_BREAK(); \
138  } \
139  } while (0)
140 
141 #define ROS_ASSERT_CMD(cond, cmd) \
142  do { \
143  if (!(cond)) { \
144  cmd; \
145  } \
146  } while (0)
147 
148 
149 #else
150 #define ROS_BREAK()
151 #define ROS_ASSERT(cond)
152 #define ROS_ASSERT_MSG(cond, ...)
153 #define ROS_ASSERT_CMD(cond, cmd)
154 #endif
155 
156 #endif // ROSCONSOLE_ROSASSERT_H
sick_scan_base.h


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:07