00001 /* Copyright (c) 2005,2007 Joerg Wunsch 00002 All rights reserved. 00003 00004 Portions of documentation Copyright (c) 1991, 1993 00005 The Regents of the University of California. 00006 00007 All rights reserved. 00008 00009 Redistribution and use in source and binary forms, with or without 00010 modification, are permitted provided that the following conditions are met: 00011 00012 * Redistributions of source code must retain the above copyright 00013 notice, this list of conditions and the following disclaimer. 00014 00015 * Redistributions in binary form must reproduce the above copyright 00016 notice, this list of conditions and the following disclaimer in 00017 the documentation and/or other materials provided with the 00018 distribution. 00019 00020 * Neither the name of the copyright holders nor the names of 00021 contributors may be used to endorse or promote products derived 00022 from this software without specific prior written permission. 00023 00024 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00027 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00028 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00029 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00030 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00031 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00032 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00033 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00034 POSSIBILITY OF SUCH DAMAGE. 00035 00036 $Id: assert.h,v 1.3 2007/01/23 15:32:48 joerg_wunsch Exp $ 00037 */ 00038 00057 00058 /* 00059 * The ability to include this file (with or without NDEBUG) is a 00060 * feature. 00061 */ 00062 00063 #undef assert 00064 00065 #if defined(__DOXYGEN__) 00066 00080 # define assert(expression) 00081 00082 #else /* !DOXYGEN */ 00083 00084 # if defined(NDEBUG) 00085 # define assert(e) ((void)0) 00086 # else /* !NDEBUG */ 00087 # if defined(__ASSERT_USE_STDERR) 00088 # define assert(e) ((e) ? (void)0 : \ 00089 __assert(__func__, __FILE__, __LINE__, #e)) 00090 # else /* !__ASSERT_USE_STDERR */ 00091 # define assert(e) ((e) ? (void)0 : abort()) 00092 # endif /* __ASSERT_USE_STDERR */ 00093 # endif /* NDEBUG */ 00094 #endif /* DOXYGEN */ 00095 00096 #ifdef __cplusplus 00097 extern "C" { 00098 #endif 00099 00100 #if !defined(__DOXYGEN__) 00101 00102 extern void __assert(const char *__func, const char *__file, 00103 int __lineno, const char *__sexp); 00104 00105 #endif /* not __DOXYGEN__ */ 00106 00107 #ifdef __cplusplus 00108 } 00109 #endif 00110 00112 /* EOF */