Declare cpu_model, machine.
[unix-history] / include / assert.h
index 2c2c5be..91bed60 100644 (file)
@@ -1,5 +1,5 @@
 /*-
 /*-
- * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1992 The Regents of the University of California.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)assert.h    4.4 (Berkeley) 4/3/91
+ *     @(#)assert.h    5.2 (Berkeley) 6/18/92
  */
 
  */
 
-#ifndef _ASSERT_H_
-#define        _ASSERT_H_
+/*
+ * Unlike other ANSI header files, <assert.h> may usefully be included
+ * multiple times, with and without NDEBUG defined.
+ */
+
+#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>
 
 
-#endif /* !_ASSERT_H_ */
+__BEGIN_DECLS
+void __assert __P((const char *, int, const char *));
+__END_DECLS