diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-03-05 10:01:45 -0600 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2011-03-05 10:01:45 -0600 |
commit | 706243ac48cf646d503a3f1ec9e6a28c916694bd (patch) | |
tree | 5d583486a145a9646eccb9d3c4bce4dad45a2a84 /src/include/assert.h | |
parent | 5c20d316d21e231daee6455f0a78d5940d59cf23 (diff) | |
download | talos-hostboot-706243ac48cf646d503a3f1ec9e6a28c916694bd.tar.gz talos-hostboot-706243ac48cf646d503a3f1ec9e6a28c916694bd.zip |
Merge of PowerHAL project up to commit:
dd45c30bd53d8e6c123165b83842d08117558a3c
Diffstat (limited to 'src/include/assert.h')
-rw-r--r-- | src/include/assert.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/assert.h b/src/include/assert.h new file mode 100644 index 000000000..13888bee8 --- /dev/null +++ b/src/include/assert.h @@ -0,0 +1,31 @@ +#include <builtins.h> + +#ifndef _ASSERT_H +#define _ASSERT_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +NO_RETURN +void __assert(bool expr, const char *exprStr, const char *file, int line); + +#define assert(expr) \ +{\ + if (!(expr))\ + {\ + __assert((expr), #expr, __FILE__, __LINE__);\ + }\ +}\ + +#ifdef NDEBUG +#undef assert +#define assert(expr) { } +#endif + +#ifdef __cplusplus +}; +#endif + +#endif |