Use balloc to extend Ifile.
[unix-history] / usr / src / include / assert.h
index a8cee82..629f916 100644 (file)
@@ -1,23 +1,34 @@
 /*-
 /*-
- * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1992 The Regents of the University of California.
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  *
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  *
- *     @(#)assert.h    4.3 (Berkeley) %G%
+ *     @(#)assert.h    5.3 (Berkeley) %G%
  */
 
  */
 
+/*
+ * Unlike other ANSI header files, <assert.h> may usefully be included
+ * multiple times, with and without NDEBUG defined.
+ */
+
+#undef assert
+#undef _assert
+
 #ifdef NDEBUG
 #ifdef NDEBUG
-#define        assert
-#define        _assert
+#define        assert(e)       ((void)0)
+#define        _assert(e)      ((void)0)
 #else
 #else
-#define        assert(expression) { \
-       if (!(expression)) { \
-               (void)fprintf(stderr, \
-                   "assertion \"%s\" failed: file \"%s\", line %d\n", \
-                   "expression", __FILE__, __LINE__); \
-               exit(2); \
-       } \
-}
-#define        _assert(expression)     assert(expression)
+#define        _assert(e)      assert(e)
+#ifdef __STDC__
+#define        assert(e)       ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
+#else  /* PCC */
+#define        assert(e)       ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e"))
 #endif
 #endif
+#endif
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+void __assert __P((const char *, int, const char *));
+__END_DECLS