From af85f97c832ba318373db3ad6df72ebedbad1a1d Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Tue, 25 Mar 2014 10:35:12 +0100 Subject: ZTS thread safety is now automatically detected when PHP-CPP is installed --- phpcpp.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'phpcpp.h') diff --git a/phpcpp.h b/phpcpp.h index 17778f4..86828a4 100644 --- a/phpcpp.h +++ b/phpcpp.h @@ -23,12 +23,30 @@ #include /** - * Disable TSRM for now + * Include PHP config */ -#define TSRMLS_C -#define TSRMLS_CC -#define TSRMLS_D -#define TSRMLS_DC +#include + +/** + * Is ZTS enabled? + */ +#ifdef ZTS + + // enable TSRM +# define TSRMLS_C tsrm_ls +# define TSRMLS_CC ,tsrm_ls +# define TSRMLS_D void ***tsrm_ls +# define TSRMLS_DC ,void ***tsrm_ls + +#else + + // disable TSRM +# define TSRMLS_C +# define TSRMLS_CC +# define TSRMLS_D +# define TSRMLS_DC + +#endif /** * Include all headers files that are related to this library -- cgit v1.2.3