mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Added function to check error and return null if error is set.
This commit is contained in:
parent
ff2af89519
commit
e3b160bf86
1 changed files with 11 additions and 1 deletions
|
@ -45,7 +45,7 @@ typedef struct _intl_data {
|
|||
obj = Z_##oclass##_P( object ); \
|
||||
intl_error_reset( INTL_DATA_ERROR_P(obj) ); \
|
||||
|
||||
/* Check status by error code, if error - exit */
|
||||
/* Check status by error code, if error return false */
|
||||
#define INTL_CHECK_STATUS(err, msg) \
|
||||
intl_error_set_code( NULL, (err) ); \
|
||||
if( U_FAILURE((err)) ) \
|
||||
|
@ -54,6 +54,16 @@ typedef struct _intl_data {
|
|||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* Check status by error code, if error return null */
|
||||
#define INTL_CHECK_STATUS_OR_NULL(err, msg) \
|
||||
intl_error_set_code( NULL, (err) ); \
|
||||
if( U_FAILURE((err)) ) \
|
||||
{ \
|
||||
intl_error_set_custom_msg( NULL, msg, 0 ); \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
|
||||
/* Check status in object, if error return false */
|
||||
#define INTL_METHOD_CHECK_STATUS(obj, msg) \
|
||||
intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue