Skip to content

Commit 8776bf8

Browse files
committed
tests: enable development checks when using PHP debug build
1 parent 2505a4c commit 8776bf8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if test "$PHP_SIMDJSON" != "no"; then
3838
src/simdjson_encoder.cpp \
3939
src/simdutf.cpp \
4040
src/simdjson.cpp],
41-
$ext_shared,, "-std=c++17 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DSIMDJSON_EXCEPTIONS=0 -DSIMDJSON_DEVELOPMENT_CHECKS=0", cxx)
41+
$ext_shared,, "-std=c++17 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1", cxx)
4242

4343
PHP_INSTALL_HEADERS([ext/simdjson], [php_simdjson.h src/simdjson_decoder_defs.h])
4444
PHP_ADD_MAKEFILE_FRAGMENT

php_simdjson.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ extern zend_module_entry simdjson_module_entry;
7373
*/
7474
#define SIMDJSON_MAX_DEDUP_LENGTH 64
7575

76+
/**
77+
* Configure simdjson library
78+
*/
79+
#define SIMDJSON_EXCEPTIONS 0
80+
81+
#ifdef ZEND_DEBUG
82+
#define SIMDJSON_DEVELOPMENT_CHECKS 1 // enable development checks when using PHP debug build
83+
#else
84+
#define SIMDJSON_DEVELOPMENT_CHECKS 0
85+
#endif
86+
7687
/*
7788
* NOTE: Namespaces and references(&) are C++ only functionality.
7889
* To expose this functionality to other C PECLs,

0 commit comments

Comments
 (0)