@@ -36,11 +36,11 @@ SOFTWARE.
36
36
#include "ext/standard/info.h"
37
37
38
38
#ifdef PHP_WIN32
39
- # define PHP_TIMECOP_API __declspec(dllexport)
39
+ # define PHP_TIMECOP_API __declspec(dllexport)
40
40
#elif defined(__GNUC__ ) && __GNUC__ >= 4
41
- # define PHP_TIMECOP_API __attribute__ ((visibility("default")))
41
+ # define PHP_TIMECOP_API __attribute__ ((visibility("default")))
42
42
#else
43
- # define PHP_TIMECOP_API
43
+ # define PHP_TIMECOP_API
44
44
#endif
45
45
46
46
#ifdef ZTS
@@ -109,30 +109,30 @@ PHP_METHOD(Timecop, freeze);
109
109
PHP_METHOD (Timecop , travel );
110
110
111
111
typedef enum timecop_mode_t {
112
- TIMECOP_MODE_REALTIME ,
113
- TIMECOP_MODE_FREEZE ,
114
- TIMECOP_MODE_TRAVEL
112
+ TIMECOP_MODE_REALTIME ,
113
+ TIMECOP_MODE_FREEZE ,
114
+ TIMECOP_MODE_TRAVEL
115
115
} timecop_mode_t ;
116
116
117
117
ZEND_BEGIN_MODULE_GLOBALS (timecop )
118
- long func_override ;
119
- long sync_request_time ;
118
+ long func_override ;
119
+ long sync_request_time ;
120
120
#if PHP_MAJOR_VERSION >= 7
121
- zval orig_request_time ;
121
+ zval orig_request_time ;
122
122
#else
123
- zval * orig_request_time ;
123
+ zval * orig_request_time ;
124
124
#endif
125
- timecop_mode_t timecop_mode ;
126
- tc_timeval freezed_time ;
127
- tc_timeval travel_origin ;
128
- tc_timeval travel_offset ;
129
- zend_long scaling_factor ;
130
- zend_class_entry * ce_DateTimeZone ;
131
- zend_class_entry * ce_DateTimeInterface ;
132
- zend_class_entry * ce_DateTime ;
133
- zend_class_entry * ce_TimecopDateTime ;
134
- zend_class_entry * ce_DateTimeImmutable ;
135
- zend_class_entry * ce_TimecopDateTimeImmutable ;
125
+ timecop_mode_t timecop_mode ;
126
+ tc_timeval freezed_time ;
127
+ tc_timeval travel_origin ;
128
+ tc_timeval travel_offset ;
129
+ zend_long scaling_factor ;
130
+ zend_class_entry * ce_DateTimeZone ;
131
+ zend_class_entry * ce_DateTimeInterface ;
132
+ zend_class_entry * ce_DateTime ;
133
+ zend_class_entry * ce_TimecopDateTime ;
134
+ zend_class_entry * ce_DateTimeImmutable ;
135
+ zend_class_entry * ce_TimecopDateTimeImmutable ;
136
136
ZEND_END_MODULE_GLOBALS (timecop )
137
137
138
138
#if ZEND_DEBUG
@@ -147,23 +147,23 @@ ZEND_END_MODULE_GLOBALS(timecop)
147
147
#define OVRD_CLASS_PREFIX "timecop"
148
148
149
149
#define ORIG_FUNC_NAME (fname ) \
150
- (TIMECOP_G(func_override) ? (SAVE_FUNC_PREFIX fname) : fname)
150
+ (TIMECOP_G(func_override) ? (SAVE_FUNC_PREFIX fname) : fname)
151
151
152
152
#define TIMECOP_OFE (fname ) {fname, OVRD_FUNC_PREFIX fname, SAVE_FUNC_PREFIX fname}
153
153
#define TIMECOP_OCE (cname , mname ) \
154
- {cname, mname, OVRD_CLASS_PREFIX cname, SAVE_FUNC_PREFIX mname}
154
+ {cname, mname, OVRD_CLASS_PREFIX cname, SAVE_FUNC_PREFIX mname}
155
155
156
156
struct timecop_override_func_entry {
157
- char * orig_func ;
158
- char * ovrd_func ;
159
- char * save_func ;
157
+ char * orig_func ;
158
+ char * ovrd_func ;
159
+ char * save_func ;
160
160
};
161
161
162
162
struct timecop_override_class_entry {
163
- char * orig_class ;
164
- char * orig_method ;
165
- char * ovrd_class ;
166
- char * save_method ;
163
+ char * orig_class ;
164
+ char * orig_method ;
165
+ char * ovrd_class ;
166
+ char * save_method ;
167
167
};
168
168
169
169
static void timecop_globals_ctor (zend_timecop_globals * globals TSRMLS_DC );
@@ -226,35 +226,35 @@ static inline void _call_php_function_with_params(const char *function_name, zva
226
226
227
227
#if PHP_MAJOR_VERSION >= 7
228
228
#define register_internal_class_ex (class_entry , parent_ce ) \
229
- zend_register_internal_class_ex(class_entry, parent_ce)
229
+ zend_register_internal_class_ex(class_entry, parent_ce)
230
230
#else
231
231
#define register_internal_class_ex (class_entry , parent_ce ) \
232
- zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC)
232
+ zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC)
233
233
#endif
234
234
235
235
#define call_php_method_with_0_params (obj , ce , method_name , retval ) \
236
- _call_php_method_with_0_params(obj, ce, method_name, retval TSRMLS_CC)
236
+ _call_php_method_with_0_params(obj, ce, method_name, retval TSRMLS_CC)
237
237
238
- #define call_php_method_with_1_params (obj , ce , method_name , retval , arg1 ) \
239
- _call_php_method_with_1_params(obj, ce, method_name, retval, arg1 TSRMLS_CC)
238
+ #define call_php_method_with_1_params (obj , ce , method_name , retval , arg1 ) \
239
+ _call_php_method_with_1_params(obj, ce, method_name, retval, arg1 TSRMLS_CC)
240
240
241
241
#define call_php_method_with_2_params (obj , ce , method_name , retval , arg1 , arg2 ) \
242
- _call_php_method_with_2_params(obj, ce, method_name, retval, arg1, arg2 TSRMLS_CC)
242
+ _call_php_method_with_2_params(obj, ce, method_name, retval, arg1, arg2 TSRMLS_CC)
243
243
244
244
#define call_php_function_with_0_params (function_name , retval ) \
245
- _call_php_function_with_0_params(function_name, retval TSRMLS_CC)
245
+ _call_php_function_with_0_params(function_name, retval TSRMLS_CC)
246
246
247
247
#define call_php_function_with_1_params (function_name , retval , arg1 ) \
248
- _call_php_function_with_1_params(function_name, retval, arg1 TSRMLS_CC)
248
+ _call_php_function_with_1_params(function_name, retval, arg1 TSRMLS_CC)
249
249
250
250
#define call_php_function_with_2_params (function_name , retval , arg1 , arg2 ) \
251
- _call_php_function_with_2_params(function_name, retval, arg1, arg2 TSRMLS_CC)
251
+ _call_php_function_with_2_params(function_name, retval, arg1, arg2 TSRMLS_CC)
252
252
253
253
#define call_php_function_with_3_params (function_name , retval , arg1 , arg2 , arg3 ) \
254
- _call_php_function_with_3_params(function_name, retval, arg1, arg2, arg3 TSRMLS_CC)
254
+ _call_php_function_with_3_params(function_name, retval, arg1, arg2, arg3 TSRMLS_CC)
255
255
256
256
#define call_php_function_with_params (function_name , retval , param_count , params ) \
257
- _call_php_function_with_params(function_name, retval, param_count, params TSRMLS_CC)
257
+ _call_php_function_with_params(function_name, retval, param_count, params TSRMLS_CC)
258
258
259
259
/* In every utility function you add that needs to use variables
260
260
in php_timecop_globals, call TSRMLS_FETCH(); after declaring other
@@ -279,7 +279,7 @@ static inline void _call_php_function_with_params(const char *function_name, zva
279
279
# endif
280
280
#endif
281
281
282
- #endif /* PHP_TIMECOP_H */
282
+ #endif /* PHP_TIMECOP_H */
283
283
284
284
/*
285
285
* Local variables:
0 commit comments