Redefine assert if already defined since some platforms already have an assert definition

This commit is contained in:
Niclas Finne 2014-03-21 14:00:13 +01:00
parent c2db3a1a14
commit db3a42fc43

View file

@ -28,9 +28,10 @@
* *
*/ */
#ifndef ASSERT_H #ifndef ASSERT_H_
#define ASSERT_H #define ASSERT_H_
#undef assert
#ifdef NDEBUG #ifdef NDEBUG
#define assert(e) ((void)0) #define assert(e) ((void)0)
#else #else
@ -44,4 +45,4 @@ void _xassert(const char *, int);
#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] #define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1]
#endif #endif
#endif /* ASSERT_H */ #endif /* ASSERT_H_ */