1313 | Author: Edmond |
1414 +----------------------------------------------------------------------+
1515*/
16+ #include "php_async.h"
1617#include "exceptions.h"
1718
1819#include <zend_API.h>
@@ -68,7 +69,7 @@ void async_register_exceptions_ce(void)
6869 async_ce_composite_exception = register_class_Async_CompositeException (zend_ce_exception );
6970}
7071
71- zend_object * async_new_exception (zend_class_entry * exception_ce , const char * format , ...)
72+ PHP_ASYNC_API zend_object * async_new_exception (zend_class_entry * exception_ce , const char * format , ...)
7273{
7374 zval exception , message_val ;
7475
@@ -95,7 +96,7 @@ zend_object *async_new_exception(zend_class_entry *exception_ce, const char *for
9596 return Z_OBJ (exception );
9697}
9798
98- ZEND_API ZEND_COLD zend_object * async_throw_error (const char * format , ...)
99+ PHP_ASYNC_API ZEND_COLD zend_object * async_throw_error (const char * format , ...)
99100{
100101 va_list args ;
101102 va_start (args , format );
@@ -115,7 +116,7 @@ ZEND_API ZEND_COLD zend_object *async_throw_error(const char *format, ...)
115116 return obj ;
116117}
117118
118- ZEND_API ZEND_COLD zend_object * async_throw_cancellation (const char * format , ...)
119+ PHP_ASYNC_API ZEND_COLD zend_object * async_throw_cancellation (const char * format , ...)
119120{
120121 const zend_object * previous_exception = EG (exception );
121122
@@ -142,7 +143,7 @@ ZEND_API ZEND_COLD zend_object *async_throw_cancellation(const char *format, ...
142143 return obj ;
143144}
144145
145- ZEND_API ZEND_COLD zend_object * async_throw_input_output (const char * format , ...)
146+ PHP_ASYNC_API ZEND_COLD zend_object * async_throw_input_output (const char * format , ...)
146147{
147148 format = format ? format : "An input/output error occurred." ;
148149
@@ -162,7 +163,7 @@ ZEND_API ZEND_COLD zend_object *async_throw_input_output(const char *format, ...
162163 return obj ;
163164}
164165
165- ZEND_API ZEND_COLD zend_object * async_throw_timeout (const char * format , const zend_long timeout )
166+ PHP_ASYNC_API ZEND_COLD zend_object * async_throw_timeout (const char * format , const zend_long timeout )
166167{
167168 format = format ? format : "A timeout of %u microseconds occurred" ;
168169
@@ -175,7 +176,7 @@ ZEND_API ZEND_COLD zend_object *async_throw_timeout(const char *format, const ze
175176 }
176177}
177178
178- ZEND_API ZEND_COLD zend_object * async_throw_poll (const char * format , ...)
179+ PHP_ASYNC_API ZEND_COLD zend_object * async_throw_poll (const char * format , ...)
179180{
180181 va_list args ;
181182 va_start (args , format );
@@ -193,15 +194,14 @@ ZEND_API ZEND_COLD zend_object *async_throw_poll(const char *format, ...)
193194 return obj ;
194195}
195196
196- ZEND_API ZEND_COLD zend_object * async_new_composite_exception (void )
197+ PHP_ASYNC_API ZEND_COLD zend_object * async_new_composite_exception (void )
197198{
198199 zval composite ;
199200 object_init_ex (& composite , async_ce_composite_exception );
200201 return Z_OBJ (composite );
201202}
202203
203- ZEND_API ZEND_COLD void
204- async_composite_exception_add_exception (zend_object * composite , zend_object * exception , bool transfer )
204+ PHP_ASYNC_API void async_composite_exception_add_exception (zend_object * composite , zend_object * exception , bool transfer )
205205{
206206 if (composite == NULL || exception == NULL ) {
207207 return ;
@@ -321,7 +321,7 @@ void async_apply_exception(zend_object **to_exception)
321321 }
322322}
323323
324- void async_rethrow_exception (zend_object * exception )
324+ PHP_ASYNC_API void async_rethrow_exception (zend_object * exception )
325325{
326326 if (EG (current_execute_data )) {
327327 zend_throw_exception_internal (exception );
0 commit comments