@@ -1597,26 +1597,22 @@ ZEND_API ZEND_COLD void zend_error_at(
1597
1597
va_end (args );
1598
1598
}
1599
1599
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)
1604
1609
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 );
1609
1612
}
1610
1613
1611
1614
ZEND_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 );
1620
1616
}
1621
1617
1622
1618
ZEND_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(
1636
1632
abort ();
1637
1633
}
1638
1634
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
+
1639
1647
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn (int type , const char * format , ...)
1640
1648
{
1641
- zend_string * filename ;
1642
- uint32_t lineno ;
1643
- va_list args ;
1649
+ zend_error_noreturn_impl (type , format );
1650
+ }
1644
1651
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 );
1651
1655
}
1652
1656
1653
1657
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn (int type , int errn , const char * message )
0 commit comments