/* Copyright 1996 Acorn Computers Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma force_top_level /* assert.h: ISO 'C' (9899:1999) library header, section 7.2 */ /* Copyright (C) Codemist Ltd. */ /* Copyright (C) Acorn Computers Ltd. 1991, 1992 */ /* version 2.01 */ /* * The assert macro puts diagnostics into programs. When it is executed, * if its argument expression is false, it writes information about the * call that failed (including the text of the argument, the name of the * source file, the source line number, and the name of the enclosing * function - the latter are respectively the values of the preprocessing * macros __FILE__ and __LINE__ and of the identifier __func__) on the * standard error stream. It then calls the abort function. * The assert macro returns no value. */ /* * Note that may be included more that once in a program with * different setting of NDEBUG. Hence the slightly unusual first-time * only flag. */ #ifndef __assert_h # define __assert_h #ifdef __cplusplus extern "C" void __assert(const char *, const char *, int); extern "C" void __assert2(const char *, const char *, const char *, int); #else extern void __assert(const char *, const char *, int); extern void __assert2(const char *, const char *, const char *, int); #endif #else # undef assert #endif #ifdef NDEBUG # define assert(ignore) ((void)0) #else # define assert(e) ((e) ? (void)0 : __assert(#e, __FILE__, __LINE__)) # ifdef __STDC_VERSION__ # if __STDC_VERSION__ >= 199901 # undef assert # define assert(e) ((e) ? (void)0 : __assert2(#e, __func__, __FILE__, __LINE__)) # endif # endif #endif /* end of assert.h */