fix gc issues
[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_CONST_CAST(t) (const t)
22 #else
23 # define HTTP_ZAPI_CONST_CAST(t) (t)
24 #endif
25
26 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
27 # define WONKY
28 #endif
29
30 #ifndef pemalloc_rel
31 # define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size))
32 #endif
33
34 #ifndef ZEND_ACC_DEPRECATED
35 # define ZEND_ACC_DEPRECATED 0
36 #endif
37
38 #if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10
39 # define php_url_parse_ex(u, l) php_url_parse(u)
40 #endif
41
42 #ifndef TSRMLS_FETCH_FROM_CTX
43 # ifdef ZTS
44 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
45 # else
46 # define TSRMLS_FETCH_FROM_CTX(ctx)
47 # endif
48 #endif
49
50 #ifndef TSRMLS_SET_CTX
51 # ifdef ZTS
52 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
53 # else
54 # define TSRMLS_SET_CTX(ctx)
55 # endif
56 #endif
57
58 #ifndef ZVAL_ADDREF
59 # define ZVAL_ADDREF Z_ADDREF_P
60 #endif
61
62 #ifndef ZVAL_ZVAL
63 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
64 int is_ref, refcount; \
65 is_ref = (z)->is_ref; \
66 refcount = (z)->refcount; \
67 *(z) = *(zv); \
68 if (copy) { \
69 zval_copy_ctor(z); \
70 } \
71 if (dtor) { \
72 if (!copy) { \
73 ZVAL_NULL(zv); \
74 } \
75 zval_ptr_dtor(&zv); \
76 } \
77 (z)->is_ref = is_ref; \
78 (z)->refcount = refcount; \
79 }
80 #endif
81 #ifndef RETVAL_ZVAL
82 # define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
83 #endif
84 #ifndef RETURN_ZVAL
85 # define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
86 #endif
87
88 #ifndef ZEND_MN
89 # define ZEND_MN(name) ZEND_FN(name)
90 #endif
91
92 #ifdef WONKY
93 extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
94 extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
95
96 extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
97 extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
98
99 extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC);
100 #endif
101
102 #endif
103
104 /*
105 * Local variables:
106 * tab-width: 4
107 * c-basic-offset: 4
108 * End:
109 * vim600: noet sw=4 ts=4 fdm=marker
110 * vim<600: noet sw=4 ts=4
111 */
112