summaryrefslogtreecommitdiffstats
path: root/php5to7.h
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-11-12 07:32:32 +0100
committerRemi Collet <remi@remirepo.net>2018-11-12 07:32:32 +0100
commit90c7782c811a87c3ac062ba3efed80b28f0f4604 (patch)
tree8a061ad0dcd127fd2634db77c42737295fe6d462 /php5to7.h
parentcb1f9d5414956bb14d221ad4fde75df27e04e122 (diff)
update to 0.8.0
drop patch merged upstream raise dependency on PHP 5.6 raise dependency on libmustache 0.5.0 open https://github.com/jbboehr/php-mustache/pull/52 missing file
Diffstat (limited to 'php5to7.h')
-rw-r--r--php5to7.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/php5to7.h b/php5to7.h
new file mode 100644
index 0000000..84fd3dd
--- /dev/null
+++ b/php5to7.h
@@ -0,0 +1,43 @@
+
+#ifndef PHP_MUSTACHE_PHP5TO7
+#define PHP_MUSTACHE_PHP5TO7
+
+#if PHP_MAJOR_VERSION >= 7
+#include <zend_string.h>
+#endif
+
+#if PHP_MAJOR_VERSION < 7
+#define _add_next_index_string(...) add_next_index_string(__VA_ARGS__, 1)
+#define _add_assoc_string(...) add_assoc_string(__VA_ARGS__, 1)
+#define _add_assoc_string_ex(...) add_assoc_string_ex(__VA_ARGS__, 1)
+#define _add_assoc_stringl_ex(...) add_assoc_stringl_ex(__VA_ARGS__, 1)
+#define _RETURN_STRING(a) RETURN_STRING(a, 1)
+#define _RETVAL_STRING(a) RETVAL_STRING(a, 1)
+#define _RETVAL_STRINGL(a, b) RETVAL_STRINGL(a, b, 1)
+#define _DECLARE_ZVAL(name) zval * name
+#define _INIT_ZVAL INIT_ZVAL
+#define _ALLOC_INIT_ZVAL(name) ALLOC_INIT_ZVAL(name)
+#define _STRS ZEND_STRS
+#define _zend_read_property(a, b, c, d, e, f) zend_read_property(a, b, c, d, e TSRMLS_CC)
+#define _zend_register_internal_class_ex(class, parent) zend_register_internal_class_ex(class, parent, NULL TSRMLS_CC)
+#define _ZVAL_STRINGL(a, b, c) ZVAL_STRINGL(a, b, c, 1)
+typedef int strsize_t;
+#else
+#define _add_next_index_string add_next_index_string
+#define _add_assoc_string(z, k, s) add_assoc_string_ex(z, k, strlen(k)+1, s)
+#define _add_assoc_string_ex add_assoc_string_ex
+#define _add_assoc_stringl_ex add_assoc_stringl_ex
+#define _RETURN_STRING(a) RETURN_STRING(a)
+#define _RETVAL_STRING(a) RETVAL_STRING(a)
+#define _RETVAL_STRINGL RETVAL_STRINGL
+#define _DECLARE_ZVAL(name) zval name ## _v; zval * name = &name ## _v
+#define _INIT_ZVAL ZVAL_NULL
+#define _ALLOC_INIT_ZVAL(name) ZVAL_NULL(name)
+#define _STRS ZEND_STRL
+#define _zend_read_property(a, b, c, d, e, f) zend_read_property(a, b, c, d, e, f)
+#define _zend_register_internal_class_ex zend_register_internal_class_ex
+#define _ZVAL_STRINGL ZVAL_STRINGL
+typedef size_t strsize_t;
+#endif
+
+#endif /* PHP_MUSTACHE_PHP5TO7 */