Define GC_ASSERT(x) as C assert(x) for external clients of gc_inline.h
authorIvan Maidanski <ivmai@mail.ru>
Tue, 28 Feb 2017 21:25:51 +0000 (00:25 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 28 Feb 2017 21:25:51 +0000 (00:25 +0300)
* include/gc_inline.h [!GC_ASSERT && !NDEBUG] (GC_ASSERT): Define as
assert(x); include assert.h.

include/gc_inline.h

index 71f9f90..177ab00 100644 (file)
 #endif /* __GNUC__ */
 
 #ifndef GC_ASSERT
-# define GC_ASSERT(expr) /* empty */
+# ifdef NDEBUG
+#   define GC_ASSERT(expr) /* empty */
+# else
+#   include <assert.h>
+#   define GC_ASSERT(expr) assert(expr)
+# endif
 #endif
 
 #ifndef GC_PREFETCH_FOR_WRITE