summaryrefslogtreecommitdiff
path: root/phpcpp.h
diff options
context:
space:
mode:
Diffstat (limited to 'phpcpp.h')
-rw-r--r--phpcpp.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/phpcpp.h b/phpcpp.h
index 17778f4..86828a4 100644
--- a/phpcpp.h
+++ b/phpcpp.h
@@ -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