|
1 | 1 | /*
|
2 | 2 | +----------------------------------------------------------------------+
|
3 |
| - | PHP Version 7 | |
| 3 | + | PHP Version 7, 8 | |
4 | 4 | +----------------------------------------------------------------------+
|
5 | 5 | | Copyright (c) The PHP Group |
|
6 | 6 | +----------------------------------------------------------------------+
|
|
13 | 13 | | [email protected] so we can mail you a copy immediately. |
|
14 | 14 | +----------------------------------------------------------------------+
|
15 | 15 | | Authors: Ard Biesheuvel <[email protected]> |
|
| 16 | + | Martin Köditz <[email protected]> | |
16 | 17 | +----------------------------------------------------------------------+
|
17 | 18 | */
|
18 | 19 |
|
|
22 | 23 |
|
23 | 24 | #include "php.h"
|
24 | 25 |
|
| 26 | +/* |
| 27 | +* Since PHP 8 we have troubles building sources on Windows, |
| 28 | +* because of missing TSRMLS_FETCH_FROM_CTX and TSRMLS_SET_CTX symbols. |
| 29 | +*/ |
| 30 | +#if PHP_VERSION_ID >= 80000 |
| 31 | +# define FBIRD_TSRMLS_FETCH_FROM_CTX(user_data) |
| 32 | +# define FBIRD_TSRMLS_SET_CTX(user_data) |
| 33 | +#else |
| 34 | +# define FBIRD_TSRMLS_FETCH_FROM_CTX(user_data) TSRMLS_FETCH_FROM_CTX(user_data) |
| 35 | +# define FBIRD_TSRMLS_SET_CTX(user_data) TSRMLS_SET_CTX(user_data) |
| 36 | +#endif |
| 37 | + |
25 | 38 | #if HAVE_IBASE
|
26 | 39 |
|
27 | 40 | #include "php_interbase.h"
|
@@ -201,7 +214,7 @@ static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */
|
201 | 214 | #endif
|
202 | 215 | {
|
203 | 216 | /* this function is called asynchronously by the Interbase client library. */
|
204 |
| - TSRMLS_FETCH_FROM_CTX(event->thread_ctx); |
| 217 | + FBIRD_TSRMLS_FETCH_FROM_CTX(event->thread_ctx); |
205 | 218 |
|
206 | 219 | /**
|
207 | 220 | * The callback function is called when the event is first registered and when the event
|
@@ -326,7 +339,7 @@ PHP_FUNCTION(ibase_set_event_handler)
|
326 | 339 |
|
327 | 340 | /* allocate the event resource */
|
328 | 341 | event = (ibase_event *) safe_emalloc(sizeof(ibase_event), 1, 0);
|
329 |
| - TSRMLS_SET_CTX(event->thread_ctx); |
| 342 | + FBIRD_TSRMLS_SET_CTX(event->thread_ctx); |
330 | 343 | event->link_res = link_res;
|
331 | 344 | GC_ADDREF(link_res);
|
332 | 345 | event->link = ib_link;
|
|
0 commit comments