Skip to content

Commit c559eae

Browse files
make assert() work no NDEBUG builds
1 parent 2449f9e commit c559eae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/zend_test/test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
#include "Zend/zend_alloc.h"
3434
#include "test_arginfo.h"
3535

36+
// `php.h` sets `NDEBUG` when not `PHP_DEBUG` which will make `assert()` from
37+
// assert.h a no-op. In order to have `assert()` working on NDEBUG builds, we
38+
// undefine `NDEBUG` and re-include assert.h
39+
#undef NDEBUG
40+
#include "assert.h"
41+
3642
#if defined(HAVE_LIBXML) && !defined(PHP_WIN32)
3743
# include <libxml/globals.h>
3844
# include <libxml/parser.h>

0 commit comments

Comments
 (0)