50 #endif // CGAL_CONFIG_H
52 #ifndef CGAL_ASSERTIONS_H
53 #define CGAL_ASSERTIONS_H
72 void warning_fail(
const char*,
const char*,
int,
const char*);
81 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
83 # define CGAL_assertion(EX) ((void)0)
84 # define CGAL_assertion_msg(EX,MSG) ((void)0)
85 # define CGAL_assertion_code(CODE)
87 # define CGAL_assertion(EX) \
88 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
89 # define CGAL_assertion_msg(EX,MSG) \
90 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
91 # define CGAL_assertion_code(CODE) CODE
92 #endif // CGAL_KERNEL_NO_ASSERTIONS
94 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
95 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
97 # define CGAL_exactness_assertion(EX) ((void)0)
98 # define CGAL_exactness_assertion_msg(EX,MSG) ((void)0)
99 # define CGAL_exactness_assertion_code(CODE)
101 # define CGAL_exactness_assertion(EX) \
102 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
103 # define CGAL_exactness_assertion_msg(EX,MSG) \
104 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
105 # define CGAL_exactness_assertion_code(CODE) CODE
106 #endif // CGAL_KERNEL_NO_ASSERTIONS
108 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
109 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
111 # define CGAL_expensive_assertion(EX) ((void)0)
112 # define CGAL_expensive_assertion_msg(EX,MSG) ((void)0)
113 # define CGAL_expensive_assertion_code(CODE)
115 # define CGAL_expensive_assertion(EX) \
116 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
117 # define CGAL_expensive_assertion_msg(EX,MSG) \
118 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
119 # define CGAL_expensive_assertion_code(CODE) CODE
120 #endif // CGAL_KERNEL_NO_ASSERTIONS
122 #if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
123 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
124 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
126 # define CGAL_expensive_exactness_assertion(EX) ((void)0)
127 # define CGAL_expensive_exactness_assertion_msg(EX,MSG) ((void)0)
128 # define CGAL_expensive_exactness_assertion_code(CODE)
130 # define CGAL_expensive_exactness_assertion(EX) \
131 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0))
132 # define CGAL_expensive_exactness_assertion_msg(EX,MSG) \
133 ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
134 # define CGAL_expensive_exactness_assertion_code(CODE) CODE
135 #endif // CGAL_KERNEL_NO_ASSERTIONS
141 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
143 # define CGAL_precondition(EX) ((void)0)
144 # define CGAL_precondition_msg(EX,MSG) ((void)0)
145 # define CGAL_precondition_code(CODE)
147 # define CGAL_precondition(EX) \
148 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
149 # define CGAL_precondition_msg(EX,MSG) \
150 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
151 # define CGAL_precondition_code(CODE) CODE
152 #endif // CGAL_KERNEL_NO_PRECONDITIONS
154 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
155 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
157 # define CGAL_exactness_precondition(EX) ((void)0)
158 # define CGAL_exactness_precondition_msg(EX,MSG) ((void)0)
159 # define CGAL_exactness_precondition_code(CODE)
161 # define CGAL_exactness_precondition(EX) \
162 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
163 # define CGAL_exactness_precondition_msg(EX,MSG) \
164 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
165 # define CGAL_exactness_precondition_code(CODE) CODE
166 #endif // CGAL_KERNEL_NO_PRECONDITIONS
168 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
169 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
171 # define CGAL_expensive_precondition(EX) ((void)0)
172 # define CGAL_expensive_precondition_msg(EX,MSG) ((void)0)
173 # define CGAL_expensive_precondition_code(CODE)
175 # define CGAL_expensive_precondition(EX) \
176 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
177 # define CGAL_expensive_precondition_msg(EX,MSG) \
178 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
179 # define CGAL_expensive_precondition_code(CODE) CODE
180 #endif // CGAL_KERNEL_NO_PRECONDITIONS
182 #if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
183 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
184 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
186 # define CGAL_expensive_exactness_precondition(EX) ((void)0)
187 # define CGAL_expensive_exactness_precondition_msg(EX,MSG) ((void)0)
188 # define CGAL_expensive_exactness_precondition_code(CODE)
190 # define CGAL_expensive_exactness_precondition(EX) \
191 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0))
192 # define CGAL_expensive_exactness_precondition_msg(EX,MSG) \
193 ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
194 # define CGAL_expensive_exactness_precondition_code(CODE) CODE
195 #endif // CGAL_KERNEL_NO_PRECONDITIONS
201 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
203 # define CGAL_postcondition(EX) ((void)0)
204 # define CGAL_postcondition_msg(EX,MSG) ((void)0)
205 # define CGAL_postcondition_code(CODE)
207 # define CGAL_postcondition(EX) \
208 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
209 # define CGAL_postcondition_msg(EX,MSG) \
210 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
211 # define CGAL_postcondition_code(CODE) CODE
212 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
214 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
215 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
217 # define CGAL_exactness_postcondition(EX) ((void)0)
218 # define CGAL_exactness_postcondition_msg(EX,MSG) ((void)0)
219 # define CGAL_exactness_postcondition_code(CODE)
221 # define CGAL_exactness_postcondition(EX) \
222 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
223 # define CGAL_exactness_postcondition_msg(EX,MSG) \
224 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
225 # define CGAL_exactness_postcondition_code(CODE) CODE
226 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
228 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
229 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
231 # define CGAL_expensive_postcondition(EX) ((void)0)
232 # define CGAL_expensive_postcondition_msg(EX,MSG) ((void)0)
233 # define CGAL_expensive_postcondition_code(CODE)
235 # define CGAL_expensive_postcondition(EX) \
236 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
237 # define CGAL_expensive_postcondition_msg(EX,MSG) \
238 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
239 # define CGAL_expensive_postcondition_code(CODE) CODE
240 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
242 #if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
243 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
244 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
246 # define CGAL_expensive_exactness_postcondition(EX) ((void)0)
247 # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) ((void)0)
248 # define CGAL_expensive_exactness_postcondition_code(CODE)
250 # define CGAL_expensive_exactness_postcondition(EX) \
251 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0))
252 # define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \
253 ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
254 # define CGAL_expensive_exactness_postcondition_code(CODE) CODE
255 #endif // CGAL_KERNEL_NO_POSTCONDITIONS
261 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
263 # define CGAL_warning(EX) ((void)0)
264 # define CGAL_warning_msg(EX,MSG) ((void)0)
265 # define CGAL_warning_code(CODE)
267 # define CGAL_warning(EX) \
268 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
269 # define CGAL_warning_msg(EX,MSG) \
270 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
271 # define CGAL_warning_code(CODE) CODE
272 #endif // CGAL_KERNEL_NO_WARNINGS
274 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
275 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
277 # define CGAL_exactness_warning(EX) ((void)0)
278 # define CGAL_exactness_warning_msg(EX,MSG) ((void)0)
279 # define CGAL_exactness_warning_code(CODE)
281 # define CGAL_exactness_warning(EX) \
282 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
283 # define CGAL_exactness_warning_msg(EX,MSG) \
284 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
285 # define CGAL_exactness_warning_code(CODE) CODE
286 #endif // CGAL_KERNEL_NO_WARNINGS
288 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
289 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
291 # define CGAL_expensive_warning(EX) ((void)0)
292 # define CGAL_expensive_warning_msg(EX,MSG) ((void)0)
293 # define CGAL_expensive_warning_code(CODE)
295 # define CGAL_expensive_warning(EX) \
296 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
297 # define CGAL_expensive_warning_msg(EX,MSG) \
298 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
299 # define CGAL_expensive_warning_code(CODE) CODE
300 #endif // CGAL_KERNEL_NO_WARNINGS
302 #if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
303 || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
304 || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\
306 # define CGAL_expensive_exactness_warning(EX) ((void)0)
307 # define CGAL_expensive_exactness_warning_msg(EX,MSG) ((void)0)
308 # define CGAL_expensive_exactness_warning_code(CODE)
310 # define CGAL_expensive_exactness_warning(EX) \
311 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0))
312 # define CGAL_expensive_exactness_warning_msg(EX,MSG) \
313 ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
314 # define CGAL_expensive_exactness_warning_code(CODE) CODE
315 #endif // CGAL_KERNEL_NO_WARNINGS
325 const char*,
const char*,
const char*, int,
const char*);
343 #endif // CGAL_ASSERTIONS_H
void warning_fail(const char *, const char *, int, const char *)
Failure_function set_error_handler(Failure_function handler)
Sets the handler for assertion-failures.
Failure_function set_warning_handler(Failure_function handler)
Failure_behaviour set_error_behaviour(Failure_behaviour eb)
Controls the behavior when an assertion fails.
void postcondition_fail(const char *, const char *, int, const char *)
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
void precondition_fail(const char *, const char *, int, const char *)
Failure_behaviour set_warning_behaviour(Failure_behaviour eb)
Failure_behaviour
Behavior of failures.
void assertion_fail(const char *, const char *, int, const char *)
Default error handler.
#define CGAL_BEGIN_NAMESPACE
#define CGAL_END_NAMESPACE