diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-25 10:35:12 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-25 10:35:12 +0100 |
commit | af85f97c832ba318373db3ad6df72ebedbad1a1d (patch) | |
tree | e5beabe1756207893b869c5213a02f98a50d25d6 /phpcpp.h | |
parent | 811c83de9e6410435b6b9c10b058b04b2fcae5c3 (diff) |
ZTS thread safety is now automatically detected when PHP-CPP is installed
Diffstat (limited to 'phpcpp.h')
-rw-r--r-- | phpcpp.h | 28 |
1 files changed, 23 insertions, 5 deletions
@@ -23,12 +23,30 @@ #include <map> /** - * Disable TSRM for now + * Include PHP config */ -#define TSRMLS_C -#define TSRMLS_CC -#define TSRMLS_D -#define TSRMLS_DC +#include <phpcpp/config.h> + +/** + * 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 |