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