diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-22 02:54:21 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-22 02:54:21 +0000 |
commit | e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795 (patch) | |
tree | b0c833b4bf82f6c71b4da2b216671599bdeb4be7 /source/include | |
parent | bd9290c36c9993a994e485da0a81df926f8662e4 (diff) | |
download | samba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.tar.gz samba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.tar.xz samba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.zip |
added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code.
Diffstat (limited to 'source/include')
-rw-r--r-- | source/include/smb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/include/smb.h b/source/include/smb.h index a11a3ac61f1..9dc1ff5f383 100644 --- a/source/include/smb.h +++ b/source/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 */ |