#ifdef __cplusplus
extern "C" {
#endif
/*
*	(c) Copyright 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*	SCCSID(@(#)assert.h	16.9	LCC)	/* Modified: 14:51:06 3/12/91 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifdef KERNEL		/* kernel assert functionality */

#ifdef	NOCHECKS
#define ASSERT(p)	
#else	/* CHECKS */
#ifdef __cplusplus
#include <stdio.h>
void panic(const char*);
#endif
#define ASSERT(p) if (!(p)) { \
			printf("assertion \"%s\" failed\n", "p"); \
			printf("	on line %d of file \"%s\"\n", \
				__LINE__, __FILE__); \
			panic("assertion failure"); \
		 } else
#endif	/* CHECKS */

#endif /* KERNEL */

#ifndef KERNEL		/* applications' assert functionality */

#ifdef NDEBUG
#define assert(EX)
#else
extern void _assert(char *,char *,int);
#ifdef __STDC__
#define assert(EX) if (EX) ; else _assert(# EX, __FILE__, __LINE__)
#else
#define assert(EX) if (EX) ; else _assert("EX", __FILE__, __LINE__)
#endif	/* __STDC__ */
#endif	/* NDEBUG */

#endif	/* !KERNEL */
#ifdef __cplusplus
}
#endif
