forked from arnaud-lb/php-rdkafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zeval.h
71 lines (53 loc) · 1.64 KB
/
zeval.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef incl_ZEVAL_H
#define incl_ZEVAL_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "php.h"
/***************************************************************************/
#ifdef ZEND_ENGINE_3
typedef zval zeval;
#define ZEVAL(v) (v)
#define P_ZEVAL(v) (&(v))
#define MAKE_STD_ZEVAL(v) ZVAL_NULL(&v)
#define ZEVAL_UNINIT(v) ZVAL_NULL(v)
#define ZE_ISDEF(v) (Z_TYPE(v) != IS_UNDEF)
#define ZE_TYPE(v) Z_TYPE(v)
#define ZE_BVAL(v) Z_BVAL(v)
#define ZE_LVAL(V) Z_LVAL(v)
#define ZE_DVAL(v) Z_DVAL(v)
#define ZE_STRVAL(v) Z_STRVAL(v)
#define ZE_STRLEN(v) Z_STRLEN(v)
#define ZE_ARRVAL(v) Z_ARRVAL(v)
#define ZE_OBJCE(v) Z_OBJCE(v)
#define ZEVAL_DUP_C
#define ZEVAL_DUP_CC
#define ZEVAL_DEREF(v) ZVAL_DEREF(v)
/***************************************************************************/
#elif defined(ZEND_ENGINE_2)
typedef zval* zeval;
#define ZEVAL(v) (*(v))
#define P_ZEVAL(v) (v)
#define MAKE_STD_ZEVAL(v) MAKE_STD_ZVAL(v)
#define ZEVAL_UNINIT(v) (v = NULL)
#define ZE_ISDEF(v) (v)
#define IS_TRUE 14
#define IS_FALSE 15
#define ZE_TYPE(v) ((Z_TYPE_P(v) == IS_BOOL) \
? (Z_BVAL_P(v) ? IS_TRUE : IS_FALSE) \
: Z_TYPE_P(v))
#define ZE_BVAL(v) Z_BVAL_P(v)
#define ZE_LVAL(V) Z_LVAL_P(v)
#define ZE_DVAL(v) Z_DVAL_P(v)
#define ZE_STRVAL(v) Z_STRVAL_P(v)
#define ZE_STRLEN(v) Z_STRLEN_P(v)
#define ZE_ARRVAL(v) Z_ARRVAL_P(v)
#define ZE_OBJCE(v) Z_OBJCE_P(v)
#define ZEVAL_DUP_C 1
#define ZEVAL_DUP_CC , 1
#define ZEVAL_DEREF(v) (v)
/***************************************************************************/
#else
# error "Unknown Zend Engine version"
#endif
#endif