PHP-5.3 zend_hash API compatibility fix
[m6w6/ext-http] / missing.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_MISSING
16 #define PHP_HTTP_MISSING
17
18 #include "php_version.h"
19
20 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
21 # define HTTP_ZAPI_HASH_TSRMLS_CC TSRMLS_CC
22 # define HTTP_ZAPI_HASH_TSRMLS_DC TSRMLS_DC
23 # define HTTP_ZAPI_CONST_CAST(t) (const t)
24 # define GLOBAL_ERROR_HANDLING EG(error_handling)
25 # define GLOBAL_EXCEPTION_CLASS EG(exception_class)
26 # define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
27 #else
28 # define HTTP_ZAPI_HASH_TSRMLS_CC
29 # define HTTP_ZAPI_HASH_TSRMLS_DC
30 # define HTTP_ZAPI_CONST_CAST(t) (t)
31 # define GLOBAL_ERROR_HANDLING PG(error_handling)
32 # define GLOBAL_EXCEPTION_CLASS PG(exception_class)
33 # define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
34 #endif
35
36 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
37 # define WONKY
38 #endif
39
40 #ifndef pemalloc_rel
41 # define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size))
42 #endif
43
44 #ifndef ZEND_ACC_DEPRECATED
45 # define ZEND_ACC_DEPRECATED 0
46 #endif
47
48 #if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10
49 # define php_url_parse_ex(u, l) php_url_parse(u)
50 #endif
51
52 #ifndef TSRMLS_FETCH_FROM_CTX
53 # ifdef ZTS
54 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
55 # else
56 # define TSRMLS_FETCH_FROM_CTX(ctx)
57 # endif
58 #endif
59
60 #ifndef TSRMLS_SET_CTX
61 # ifdef ZTS
62 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
63 # else
64 # define TSRMLS_SET_CTX(ctx)
65 # endif
66 #endif
67
68 #ifndef ZVAL_ADDREF
69 # define ZVAL_ADDREF Z_ADDREF_P
70 #endif
71
72 #ifndef ZVAL_ZVAL
73 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
74 int is_ref, refcount; \
75 is_ref = (z)->is_ref; \
76 refcount = (z)->refcount; \
77 *(z) = *(zv); \
78 if (copy) { \
79 zval_copy_ctor(z); \
80 } \
81 if (dtor) { \
82 if (!copy) { \
83 ZVAL_NULL(zv); \
84 } \
85 zval_ptr_dtor(&zv); \
86 } \
87 (z)->is_ref = is_ref; \
88 (z)->refcount = refcount; \
89 }
90 #endif
91 #ifndef RETVAL_ZVAL
92 # define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
93 #endif
94 #ifndef RETURN_ZVAL
95 # define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
96 #endif
97
98 #ifndef ZEND_MN
99 # define ZEND_MN(name) ZEND_FN(name)
100 #endif
101
102 #ifdef WONKY
103 extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
104 extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
105
106 extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
107 extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
108
109 extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC);
110 #endif
111
112 #endif
113
114 /*
115 * Local variables:
116 * tab-width: 4
117 * c-basic-offset: 4
118 * End:
119 * vim600: noet sw=4 ts=4 fdm=marker
120 * vim<600: noet sw=4 ts=4
121 */
122