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