4 * Define the assert macro for debug output.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 2002/09/08 10:22:30 $
37 * If not debugging, assert does nothing.
39 #define assert(x) ((void)0);
41 #else /* debugging enabled */
44 * CRTDLL nicely supplies a function which does the actual output and
47 #ifndef __ATTRIB_NORETURN
49 #define _ATTRIB_NORETURN __attribute__ ((noreturn))
50 #else /* Not __GNUC__ */
51 #define _ATTRIB_NORETURN
55 void _assert (const char* szExpression
, const char* szFileName
, int nLine
)
60 * Definition of the assert macro.
62 #define assert(x) if(!(x)) _assert( #x , __FILE__, __LINE__);