summaryrefslogtreecommitdiff
path: root/zend/includes.h
blob: 4908e77ffcd63d8bf2613150ba9b1414a7a78ed8 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/**
 *  Includes.h
 *
 *  Startup include file to compile the phpcpp library
 *
 *  @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
 *  @copyright 2013 Copernica BV
 */

/**
 *  Include standard C and C++ libraries
 */
#include <stdlib.h>
#include <string>
#include <initializer_list>
#include <vector>
#include <map>
#include <set>
#include <memory>
#include <list>
#include <exception>
#include <type_traits>
#include <functional>

// for debug
#include <iostream>

//#define ZTS
//#define THREAD_T pthread_t
//#define MUTEX_T pthread_mutex_t *

/**
 *  PHP includes
 */
#pragma GCC system_header
#include <php.h>
#include <zend_exceptions.h>
#include <zend_interfaces.h>
#include <zend_ini.h>
#include <SAPI.h>

/**
 *  We don't compile for php7 just yet
 */
#if PHP_VERSION_ID < 70000
#   error "This library required PHP version 7.0 or higher. Use PHP-CPP-LEGACY for older versions."
#endif

/**
 *  Macro to convert results to success status
 */
#define BOOL2SUCCESS(b) ((b) ? SUCCESS : FAILURE)

/**
 *  Include other files from this library
 */
#include "../include/visibility.h"
#include "../include/noexcept.h"
#include "../include/platform.h"
#include "../include/version.h"
#include "../include/inivalue.h"
#include "../include/ini.h"
#include "../include/exception.h"
#include "../include/fatalerror.h"
#include "../include/streams.h"
#include "../include/type.h"
#include "../include/errors.h"
#include "../include/hashparent.h"
#include "../include/value.h"
#include "../include/valueiterator.h"
#include "../include/array.h"
#include "../include/object.h"
#include "../include/globals.h"
#include "../include/argument.h"
#include "../include/byval.h"
#include "../include/byref.h"
#include "../include/global.h"
#include "../include/hashmember.h"
#include "../include/super.h"
#include "../include/parameters.h"
#include "../include/modifiers.h"
#include "../include/base.h"
#include "../include/countable.h"
#include "../include/arrayaccess.h"
#include "../include/serializable.h"
#include "../include/iterator.h"
#include "../include/traversable.h"
#include "../include/classtype.h"
#include "../include/classbase.h"
#include "../include/interface.h"
#include "../include/constant.h"
#include "../include/class.h"
#include "../include/namespace.h"
#include "../include/extension.h"
#include "../include/call.h"
#include "../include/script.h"
#include "../include/file.h"
#include "../include/function.h"

/**
 *  Common header files for internal use only
 */
#include "../common/extensionbase.h"
#include "../common/streambuf.h"

/**
 *  Specific zend implementation  files for internal use only
 */
#include "hiddenpointer.h"
#include "init.h"
#include "callable.h"
#include "nativefunction.h"
#include "method.h"
#include "member.h"
#include "nullmember.h"
#include "numericmember.h"
#include "boolmember.h"
#include "stringmember.h"
#include "floatmember.h"
#include "arithmetic.h"
#include "origexception.h"
#include "notimplemented.h"
#include "property.h"
#include "valueiteratorimpl.h"
#include "hashiterator.h"
#include "invaliditerator.h"
#include "traverseiterator.h"
#include "iteratorimpl.h"
#include "classimpl.h"
#include "objectimpl.h"
#include "parametersimpl.h"
#include "extensionimpl.h"
#include "compileroptions.h"
#include "executestate.h"
#include "opcodes.h"
#include "functor.h"
#include "constantimpl.h"
#include "delayedfree.h"
#include "extensionpath.h"
#include "symbol.h"
#include "module.h"

#ifndef ZVAL_COPY_VALUE
#define ZVAL_COPY_VALUE(z, v)  \
  do {                         \
    (z)->value = (v)->value;   \
    Z_TYPE_P(z) = Z_TYPE_P(v); \
  } while (0)
#endif

#ifndef INIT_PZVAL_COPY
#define INIT_PZVAL_COPY(z, v)  \
  do {                         \
    ZVAL_COPY_VALUE(z, v);     \
    Z_SET_REFCOUNT_P(z, 1);    \
    Z_UNSET_ISREF_P(z);        \
  } while (0)
#endif