xref: /onnv-gate/usr/src/lib/libc/inc/thr_debug.h (revision 2248:4609e8bb25ad)
1*2248Sraf /*
2*2248Sraf  * CDDL HEADER START
3*2248Sraf  *
4*2248Sraf  * The contents of this file are subject to the terms of the
5*2248Sraf  * Common Development and Distribution License (the "License").
6*2248Sraf  * You may not use this file except in compliance with the License.
7*2248Sraf  *
8*2248Sraf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2248Sraf  * or http://www.opensolaris.org/os/licensing.
10*2248Sraf  * See the License for the specific language governing permissions
11*2248Sraf  * and limitations under the License.
12*2248Sraf  *
13*2248Sraf  * When distributing Covered Code, include this CDDL HEADER in each
14*2248Sraf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2248Sraf  * If applicable, add the following below this CDDL HEADER, with the
16*2248Sraf  * fields enclosed by brackets "[]" replaced with your own identifying
17*2248Sraf  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2248Sraf  *
19*2248Sraf  * CDDL HEADER END
20*2248Sraf  */
21*2248Sraf 
22*2248Sraf /*
23*2248Sraf  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2248Sraf  * Use is subject to license terms.
25*2248Sraf  */
26*2248Sraf 
27*2248Sraf #ifndef _THR_DEBUG_H
28*2248Sraf #define	_THR_DEBUG_H
29*2248Sraf 
30*2248Sraf #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*2248Sraf 
32*2248Sraf #if defined(THREAD_DEBUG)
33*2248Sraf 
34*2248Sraf extern void __assfail(const char *, const char *, int);
35*2248Sraf #pragma rarely_called(__assfail)
36*2248Sraf #define	ASSERT(EX)	(void)((EX) || (__assfail(#EX, __FILE__, __LINE__), 0))
37*2248Sraf 
38*2248Sraf #else
39*2248Sraf 
40*2248Sraf #define	ASSERT(EX)	((void)0)
41*2248Sraf 
42*2248Sraf #endif
43*2248Sraf 
44*2248Sraf #endif	/* _THR_DEBUG_H */
45