diff options
Diffstat (limited to 'src/debug.h')
-rw-r--r-- | src/debug.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/debug.h b/src/debug.h new file mode 100644 index 0000000..e776fd1 --- /dev/null +++ b/src/debug.h @@ -0,0 +1,56 @@ +/* + * AUTHOR + * N. Nielsen + * + * LICENSE + * This software is in the public domain. + * + * The software is provided "as is", without warranty of any kind, + * express or implied, including but not limited to the warranties + * of merchantability, fitness for a particular purpose, and + * noninfringement. In no event shall the author(s) be liable for any + * claim, damages, or other liability, whether in an action of + * contract, tort, or otherwise, arising from, out of, or in connection + * with the software or the use or other dealings in the software. + * + * SUPPORT + * Send bug reports to: <nielsen@memberwebs.com> + */ + +#ifdef _DEBUG + +#include <stdarg.h> + +#ifndef ASSERT + #ifdef ATLASSERT + #define ASSERT ATLASSERT + #else + #include <assert.h> + #define ASSERT assert + #endif +#endif + +#ifndef VERIFY +#define VERIFY(f) ASSERT(f) +#endif + +#ifndef DEBUG_ONLY +#define DEBUG_ONLY(f) (f) +#endif + + +#else /* !DEBUG */ + +#ifndef ASSERT +#define ASSERT(f) ((void)0) +#endif + +#ifndef VERIFY +#define VERIFY(f) ((void)(f)) +#endif + +#ifndef DEBUG_ONLY +#define DEBUG_ONLY(f) ((void)0) +#endif + +#endif /* _DEBUG */ |