@@ -1597,26 +1597,22 @@ ZEND_API ZEND_COLD void zend_error_at(
15971597 va_end (args );
15981598}
15991599
1600- ZEND_API ZEND_COLD void zend_error (int type , const char * format , ...) {
1601- zend_string * filename ;
1602- uint32_t lineno ;
1603- va_list args ;
1600+ #define zend_error_impl (type , format ) do { \
1601+ zend_string *filename; \
1602+ uint32_t lineno; \
1603+ va_list args; \
1604+ get_filename_lineno(type, &filename, &lineno); \
1605+ va_start(args, format); \
1606+ zend_error_va_list(type, filename, lineno, format, args); \
1607+ va_end(args); \
1608+ } while (0)
16041609
1605- get_filename_lineno (type , & filename , & lineno );
1606- va_start (args , format );
1607- zend_error_va_list (type , filename , lineno , format , args );
1608- va_end (args );
1610+ ZEND_API ZEND_COLD void zend_error (int type , const char * format , ...) {
1611+ zend_error_impl (type , format );
16091612}
16101613
16111614ZEND_API ZEND_COLD void zend_error_unchecked (int type , const char * format , ...) {
1612- zend_string * filename ;
1613- uint32_t lineno ;
1614- va_list args ;
1615-
1616- get_filename_lineno (type , & filename , & lineno );
1617- va_start (args , format );
1618- zend_error_va_list (type , filename , lineno , format , args );
1619- va_end (args );
1615+ zend_error_impl (type , format );
16201616}
16211617
16221618ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn (
@@ -1636,18 +1632,26 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
16361632 abort ();
16371633}
16381634
1635+ #define zend_error_noreturn_impl (type , format ) do { \
1636+ zend_string *filename; \
1637+ uint32_t lineno; \
1638+ va_list args; \
1639+ get_filename_lineno(type, &filename, &lineno); \
1640+ va_start(args, format); \
1641+ zend_error_va_list(type, filename, lineno, format, args); \
1642+ va_end(args); \
1643+ /* Should never reach this. */ \
1644+ abort (); \
1645+ } while (0 )
1646+
16391647ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn (int type , const char * format , ...)
16401648{
1641- zend_string * filename ;
1642- uint32_t lineno ;
1643- va_list args ;
1649+ zend_error_noreturn_impl (type , format );
1650+ }
16441651
1645- get_filename_lineno (type , & filename , & lineno );
1646- va_start (args , format );
1647- zend_error_va_list (type , filename , lineno , format , args );
1648- va_end (args );
1649- /* Should never reach this. */
1650- abort ();
1652+ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn_unchecked (int type , const char * format , ...)
1653+ {
1654+ zend_error_noreturn_impl (type , format );
16511655}
16521656
16531657ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn (int type , int errn , const char * message )
0 commit comments