]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/assert.h
xnu-792.tar.gz
[apple/xnu.git] / osfmk / kern / assert.h
index b7c9317e7270960f5ce2c1c568c635623ab1f517..fc390b5aa5e155b65a04a67ba0c91b5f1668faef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
 /*     assert.h        4.2     85/01/21        */
 
 #include <kern/macro_help.h>
+#include <sys/cdefs.h>
 
 #ifdef MACH_KERNEL_PRIVATE
 #include <mach_assert.h>
 #endif
 
+__BEGIN_DECLS
 /* Assert error */
 extern void    Assert(
                        const char      *file,
                        int             line,
                        const char      *expression);
+__END_DECLS
 
 #if    MACH_ASSERT
 
-#define assert(ex)                                                     \
-MACRO_BEGIN                                                            \
-       if (!(ex))                                                      \
-               Assert(__FILE__, __LINE__, # ex);                       \
-MACRO_END
+#define assert(ex)  \
+    ((ex) ? (void)0 : Assert(__FILE__, __LINE__, # ex))
 #define        assert_static(x)        assert(x)
 
+#define __assert_only
+
 #else  /* MACH_ASSERT */
 
 #define assert(ex)             ((void)0)
 #define assert_static(ex)
 
+#define __assert_only __unused
+
 #endif /* MACH_ASSERT */
 
 #endif /* _KERN_ASSERT_H_ */