- Fix build
[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 # define HTTP_STATIC_ARG_INFO
28 #else
29 # define HTTP_ZAPI_HASH_TSRMLS_CC
30 # define HTTP_ZAPI_HASH_TSRMLS_DC
31 # define HTTP_ZAPI_CONST_CAST(t) (t)
32 # define GLOBAL_ERROR_HANDLING PG(error_handling)
33 # define GLOBAL_EXCEPTION_CLASS PG(exception_class)
34 # define IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
35 # define HTTP_STATIC_ARG_INFO static
36 #endif
37
38 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
39 # define WONKY
40 #endif
41
42 #ifndef pemalloc_rel
43 # define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size))
44 #endif
45
46 #ifndef ZEND_ACC_DEPRECATED
47 # define ZEND_ACC_DEPRECATED 0
48 #endif
49
50 #if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10
51 # define php_url_parse_ex(u, l) php_url_parse(u)
52 #endif
53
54 #ifndef TSRMLS_FETCH_FROM_CTX
55 # ifdef ZTS
56 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
57 # else
58 # define TSRMLS_FETCH_FROM_CTX(ctx)
59 # endif
60 #endif
61
62 #ifndef TSRMLS_SET_CTX
63 # ifdef ZTS
64 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
65 # else
66 # define TSRMLS_SET_CTX(ctx)
67 # endif
68 #endif
69
70 #ifndef ZVAL_ADDREF
71 # define ZVAL_ADDREF Z_ADDREF_P
72 #endif
73
74 #ifndef SEPARATE_ARG_IF_REF
75 #define SEPARATE_ARG_IF_REF(zv) \
76 if (PZVAL_IS_REF(zv)) { \
77 zval *ov = zv; \
78 ALLOC_INIT_ZVAL(zv); \
79 Z_TYPE_P(zv) = Z_TYPE_P(ov); \
80 zv->value = ov->value; \
81 zval_copy_ctor(zv); \
82 } else { \
83 ZVAL_ADDREF(zv); \
84 }
85 #endif
86
87 #ifndef ZVAL_ZVAL
88 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
89 int is_ref, refcount; \
90 is_ref = (z)->is_ref; \
91 refcount = (z)->refcount; \
92 *(z) = *(zv); \
93 if (copy) { \
94 zval_copy_ctor(z); \
95 } \
96 if (dtor) { \
97 if (!copy) { \
98 ZVAL_NULL(zv); \
99 } \
100 zval_ptr_dtor(&zv); \
101 } \
102 (z)->is_ref = is_ref; \
103 (z)->refcount = refcount; \
104 }
105 #endif
106 #ifndef RETVAL_ZVAL
107 # define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
108 #endif
109 #ifndef RETURN_ZVAL
110 # define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
111 #endif
112
113 #ifndef ZEND_MN
114 # define ZEND_MN(name) ZEND_FN(name)
115 #endif
116
117 #ifdef WONKY
118 extern int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
119 extern void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
120
121 extern int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
122 extern void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
123
124 extern void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC);
125 #endif
126
127 #endif
128
129 /*
130 * Local variables:
131 * tab-width: 4
132 * c-basic-offset: 4
133 * End:
134 * vim600: noet sw=4 ts=4 fdm=marker
135 * vim<600: noet sw=4 ts=4
136 */
137