summaryrefslogtreecommitdiff
path: root/source/include/smb_macros.h
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-04-16 20:48:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:38 -0500
commit70178d5d27900d56ad1da3c99f3a63d863fb324c (patch)
tree79038453c09a9fed43559b736bcc427721ea32fb /source/include/smb_macros.h
parent6b84f30e3d746a13613d94071501430fef8ee2ca (diff)
downloadsamba-70178d5d27900d56ad1da3c99f3a63d863fb324c.tar.gz
r6358: merging SMB_ASSERT() changes from the release branch
Diffstat (limited to 'source/include/smb_macros.h')
-rw-r--r--source/include/smb_macros.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h
index 04616eb8abe..6d1e382bb82 100644
--- a/source/include/smb_macros.h
+++ b/source/include/smb_macros.h
@@ -66,9 +66,16 @@
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
/* assert macros */
-#define SMB_ASSERT(b) ((b)?(void)0: \
+#ifdef DEVELOPER
+#define SMB_ASSERT(b) ( (b) ? (void)0 : \
(DEBUG(0,("PANIC: assert failed at %s(%d)\n", \
__FILE__, __LINE__)), smb_panic("assert failed")))
+#else
+/* redefine the assert macro for non-developer builds */
+#define SMB_ASSERT(b) ( (b) ? (void)0 : \
+ (DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__))))
+#endif
+
#define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n))
/* these are useful macros for checking validity of handles */