summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-22 02:54:21 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-22 02:54:21 +0000
commit3f3f47b0bd8d089120d267cfad1976db95cd8ebe (patch)
tree145ed3a2c31999fa352c123b3a366a96ce4dde62 /source3/include
parentbce4d95ca9f0f1b175f5eff682c961754d494253 (diff)
downloadsamba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.tar.gz
samba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.tar.bz2
samba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.zip
added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code. (This used to be commit e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index a11a3ac61f..9dc1ff5f38 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1561,6 +1561,10 @@ extern int unix_ERR_code;
/* useful macros */
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+#define ASSERT(b) ((b)?0: \
+ (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \
+ __FILE__, __LINE__)), smb_panic("assert failed")))
+#define ASSERT_ARRAY(a,n) ASSERT((sizeof(a)/sizeof((a)[0])) >= (n))
#endif /* _SMB_H */