BWAPI
|
00001 // Copyright (c) 1997-2007 ETH Zurich (Switzerland). 00002 // All rights reserved. 00003 // 00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under 00005 // the terms of the Q Public License version 1.0. 00006 // See the file LICENSE.QPL distributed with CGAL. 00007 // 00008 // Licensees holding a valid commercial license may use this file in 00009 // accordance with the commercial license agreement provided with the software. 00010 // 00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 // 00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/QP_solver/include/CGAL/QP_solver/assertions.h $ 00015 // $Id: assertions.h 44139 2008-07-14 11:16:41Z spion $ 00016 // 00017 // 00018 // Author(s) : Sven Schoenherr 00019 // Bernd Gaertner <gaertner@inf.ethz.ch> 00020 // Franz Wessendorp 00021 // Kaspar Fischer 00022 00023 #ifndef CGAL_QP_ASSERTIONS_H 00024 #define CGAL_QP_ASSERTIONS_H 00025 00026 // ================= 00027 // macro definitions 00028 // ================= 00029 00030 // ---------- 00031 // assertions 00032 // ---------- 00033 #if ( defined( CGAL_QP_NO_ASSERTIONS) \ 00034 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00035 # define CGAL_qpe_assertion(EX) ((void)0) 00036 # define CGAL_qpe_assertion_msg(EX,MSG) ((void)0) 00037 # define CGAL_qpe_assertion_code(CODE) 00038 #else 00039 # define CGAL_qpe_assertion(EX) \ 00040 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00041 # define CGAL_qpe_assertion_msg(EX,MSG) \ 00042 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00043 # define CGAL_qpe_assertion_code(CODE) CODE 00044 #endif // qpe assertions 00045 00046 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00047 || defined( CGAL_CHECK_EXACTNESS) ) \ 00048 || defined( CGAL_QP_NO_ASSERTIONS) \ 00049 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00050 # define CGAL_qpe_exactness_assertion(EX) ((void)0) 00051 # define CGAL_qpe_exactness_assertion_msg(EX,MSG) ((void)0) 00052 # define CGAL_qpe_exactness_assertion_code(CODE) 00053 #else 00054 # define CGAL_qpe_exactness_assertion(EX) \ 00055 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00056 # define CGAL_qpe_exactness_assertion_msg(EX,MSG) \ 00057 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00058 # define CGAL_qpe_exactness_assertion_code(CODE) CODE 00059 #endif // qpe exactness assertions 00060 00061 #if ( ! ( defined( CGAL_QP_CHECK_EXPENSIVE) \ 00062 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00063 || defined( CGAL_QP_NO_ASSERTIONS) \ 00064 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00065 # define CGAL_qpe_expensive_assertion(EX) ((void)0) 00066 # define CGAL_qpe_expensive_assertion_msg(EX,MSG) ((void)0) 00067 # define CGAL_qpe_expensive_assertion_code(CODE) 00068 #else 00069 # define CGAL_qpe_expensive_assertion(EX) \ 00070 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00071 # define CGAL_qpe_expensive_assertion_msg(EX,MSG) \ 00072 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00073 # define CGAL_qpe_expensive_assertion_code(CODE) CODE 00074 #endif // qpe expensive assertions 00075 00076 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00077 || defined( CGAL_QP_CHECK_EXPENSIVE) \ 00078 || defined( CGAL_CHECK_EXACTNESS) \ 00079 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00080 || defined( CGAL_QP_NO_ASSERTIONS) \ 00081 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00082 # define CGAL_qpe_expensive_exactness_assertion(EX) \ 00083 ((void)0) 00084 # define CGAL_qpe_expensive_exactness_assertion_msg(EX,MSG) \ 00085 ((void)0) 00086 # define CGAL_qpe_expensive_exactness_assertion_code(CODE) 00087 #else 00088 # define CGAL_qpe_expensive_exactness_assertion(EX) \ 00089 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00090 # define CGAL_qpe_expensive_exactness_assertion_msg(EX,MSG) \ 00091 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00092 # define CGAL_qpe_expensive_exactness_assertion_code(CODE) CODE 00093 #endif // qpe expensive exactness assertions 00094 00095 00096 // ------------- 00097 // preconditions 00098 // ------------- 00099 #if ( defined( CGAL_QP_NO_PRECONDITIONS) \ 00100 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00101 # define CGAL_qpe_precondition(EX) ((void)0) 00102 # define CGAL_qpe_precondition_msg(EX,MSG) ((void)0) 00103 # define CGAL_qpe_precondition_code(CODE) 00104 #else 00105 # define CGAL_qpe_precondition(EX) \ 00106 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00107 # define CGAL_qpe_precondition_msg(EX,MSG) \ 00108 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00109 # define CGAL_qpe_precondition_code(CODE) CODE 00110 #endif // qpe preconditions 00111 00112 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00113 || defined( CGAL_CHECK_EXACTNESS) ) \ 00114 || defined( CGAL_QP_NO_PRECONDITIONS) \ 00115 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00116 # define CGAL_qpe_exactness_precondition(EX) ((void)0) 00117 # define CGAL_qpe_exactness_precondition_msg(EX,MSG) ((void)0) 00118 # define CGAL_qpe_exactness_precondition_code(CODE) 00119 #else 00120 # define CGAL_qpe_exactness_precondition(EX) \ 00121 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00122 # define CGAL_qpe_exactness_precondition_msg(EX,MSG) \ 00123 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00124 # define CGAL_qpe_exactness_precondition_code(CODE) CODE 00125 #endif // qpe exactness preconditions 00126 00127 #if ( ! ( defined( CGAL_QP_CHECK_EXPENSIVE) \ 00128 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00129 || defined( CGAL_QP_NO_PRECONDITIONS) \ 00130 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00131 # define CGAL_qpe_expensive_precondition(EX) ((void)0) 00132 # define CGAL_qpe_expensive_precondition_msg(EX,MSG) ((void)0) 00133 # define CGAL_qpe_expensive_precondition_code(CODE) 00134 #else 00135 # define CGAL_qpe_expensive_precondition(EX) \ 00136 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00137 # define CGAL_qpe_expensive_precondition_msg(EX,MSG) \ 00138 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00139 # define CGAL_qpe_expensive_precondition_code(CODE) CODE 00140 #endif // qpe expensive preconditions 00141 00142 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00143 || defined( CGAL_QP_CHECK_EXPENSIVE) \ 00144 || defined( CGAL_CHECK_EXACTNESS) \ 00145 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00146 || defined( CGAL_QP_NO_PRECONDITIONS) \ 00147 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00148 # define CGAL_qpe_expensive_exactness_precondition(EX) \ 00149 ((void)0) 00150 # define CGAL_qpe_expensive_exactness_precondition_msg(EX,MSG) \ 00151 ((void)0) 00152 # define CGAL_qpe_expensive_exactness_precondition_code(CODE) 00153 #else 00154 # define CGAL_qpe_expensive_exactness_precondition(EX) \ 00155 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00156 # define CGAL_qpe_expensive_exactness_precondition_msg(EX,MSG) \ 00157 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00158 # define CGAL_qpe_expensive_exactness_precondition_code(CODE) CODE 00159 #endif // qpe expensive exactness preconditions 00160 00161 00162 // -------------- 00163 // postconditions 00164 // -------------- 00165 #if ( defined( CGAL_QP_NO_POSTCONDITIONS) \ 00166 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00167 # define CGAL_qpe_postcondition(EX) ((void)0) 00168 # define CGAL_qpe_postcondition_msg(EX,MSG) ((void)0) 00169 # define CGAL_qpe_postcondition_code(CODE) 00170 #else 00171 # define CGAL_qpe_postcondition(EX) \ 00172 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00173 # define CGAL_qpe_postcondition_msg(EX,MSG) \ 00174 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00175 # define CGAL_qpe_postcondition_code(CODE) CODE 00176 #endif // qpe postconditions 00177 00178 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00179 || defined( CGAL_CHECK_EXACTNESS) ) \ 00180 || defined( CGAL_QP_NO_POSTCONDITIONS) \ 00181 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00182 # define CGAL_qpe_exactness_postcondition(EX) ((void)0) 00183 # define CGAL_qpe_exactness_postcondition_msg(EX,MSG) ((void)0) 00184 # define CGAL_qpe_exactness_postcondition_code(CODE) 00185 #else 00186 # define CGAL_qpe_exactness_postcondition(EX) \ 00187 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00188 # define CGAL_qpe_exactness_postcondition_msg(EX,MSG) \ 00189 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00190 # define CGAL_qpe_exactness_postcondition_code(CODE) CODE 00191 #endif // qpe exactness postconditions 00192 00193 #if ( ! ( defined( CGAL_QP_CHECK_EXPENSIVE) \ 00194 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00195 || defined( CGAL_QP_NO_POSTCONDITIONS) \ 00196 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00197 # define CGAL_qpe_expensive_postcondition(EX) ((void)0) 00198 # define CGAL_qpe_expensive_postcondition_msg(EX,MSG) ((void)0) 00199 # define CGAL_qpe_expensive_postcondition_code(CODE) 00200 #else 00201 # define CGAL_qpe_expensive_postcondition(EX) \ 00202 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00203 # define CGAL_qpe_expensive_postcondition_msg(EX,MSG) \ 00204 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00205 # define CGAL_qpe_expensive_postcondition_code(CODE) CODE 00206 #endif // qpe expensive postconditions 00207 00208 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00209 || defined( CGAL_QP_CHECK_EXPENSIVE) \ 00210 || defined( CGAL_CHECK_EXACTNESS) \ 00211 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00212 || defined( CGAL_QP_NO_POSTCONDITIONS) \ 00213 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00214 # define CGAL_qpe_expensive_exactness_postcondition(EX) \ 00215 ((void)0) 00216 # define CGAL_qpe_expensive_exactness_postcondition_msg(EX,MSG) \ 00217 ((void)0) 00218 # define CGAL_qpe_expensive_exactness_postcondition_code(CODE) 00219 #else 00220 # define CGAL_qpe_expensive_exactness_postcondition(EX) \ 00221 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00222 # define CGAL_qpe_expensive_exactness_postcondition_msg(EX,MSG) \ 00223 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00224 # define CGAL_qpe_expensive_exactness_postcondition_code(CODE) CODE 00225 #endif // qpe expensive exactness postconditions 00226 00227 00228 // -------- 00229 // warnings 00230 // -------- 00231 #if ( defined( CGAL_QP_NO_WARNINGS) \ 00232 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00233 # define CGAL_qpe_warning(EX) ((void)0) 00234 # define CGAL_qpe_warning_msg(EX,MSG) ((void)0) 00235 # define CGAL_qpe_warning_code(CODE) 00236 #else 00237 # define CGAL_qpe_warning(EX) \ 00238 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00239 # define CGAL_qpe_warning_msg(EX,MSG) \ 00240 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00241 # define CGAL_qpe_warning_code(CODE) CODE 00242 #endif // qpe warnings 00243 00244 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00245 || defined( CGAL_CHECK_EXACTNESS) ) \ 00246 || defined( CGAL_QP_NO_WARNINGS) \ 00247 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00248 # define CGAL_qpe_exactness_warning(EX) ((void)0) 00249 # define CGAL_qpe_exactness_warning_msg(EX,MSG) ((void)0) 00250 # define CGAL_qpe_exactness_warning_code(CODE) 00251 #else 00252 # define CGAL_qpe_exactness_warning(EX) \ 00253 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00254 # define CGAL_qpe_exactness_warning_msg(EX,MSG) \ 00255 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00256 # define CGAL_qpe_exactness_warning_code(CODE) CODE 00257 #endif // qpe exactness warnings 00258 00259 #if ( ! ( defined( CGAL_QP_CHECK_EXPENSIVE) \ 00260 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00261 || defined( CGAL_QP_NO_WARNINGS) \ 00262 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00263 # define CGAL_qpe_expensive_warning(EX) ((void)0) 00264 # define CGAL_qpe_expensive_warning_msg(EX,MSG) ((void)0) 00265 # define CGAL_qpe_expensive_warning_code(CODE) 00266 #else 00267 # define CGAL_qpe_expensive_warning(EX) \ 00268 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00269 # define CGAL_qpe_expensive_warning_msg(EX,MSG) \ 00270 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00271 # define CGAL_qpe_expensive_warning_code(CODE) CODE 00272 #endif // qpe expensive warnings 00273 00274 #if ( ! ( defined( CGAL_QP_CHECK_EXACTNESS) \ 00275 || defined( CGAL_QP_CHECK_EXPENSIVE) \ 00276 || defined( CGAL_CHECK_EXACTNESS) \ 00277 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00278 || defined( CGAL_QP_NO_WARNINGS) \ 00279 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00280 # define CGAL_qpe_expensive_exactness_warning(EX) \ 00281 ((void)0) 00282 # define CGAL_qpe_expensive_exactness_warning_msg(EX,MSG) \ 00283 ((void)0) 00284 # define CGAL_qpe_expensive_exactness_warning_code(CODE) 00285 #else 00286 # define CGAL_qpe_expensive_exactness_warning(EX) \ 00287 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00288 # define CGAL_qpe_expensive_exactness_warning_msg(EX,MSG) \ 00289 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00290 # define CGAL_qpe_expensive_exactness_warning_code(CODE) CODE 00291 #endif // qpe expensive exactness warnings 00292 00293 00294 #endif // CGAL_QP_ASSERTIONS_H 00295 00296 // ===== EOF ==================================================================