diff options
author | Daniel Persson <daniel.persson@textalk.se> | 2015-09-07 22:15:23 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-04-08 12:31:19 +0200 |
commit | e3b160bf864fa3b6b2bf938e62f18768032980ab (patch) | |
tree | 2db732d0f5b257eb40c7bbf2d2c00b4c70a9dd12 | |
parent | ff2af8951986c1192b82b0fe492528d3b758e11c (diff) | |
download | php-git-e3b160bf864fa3b6b2bf938e62f18768032980ab.tar.gz |
Added function to check error and return null if error is set.
-rw-r--r-- | ext/intl/intl_data.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h index 12e0a9924e..74b7092fbb 100644 --- a/ext/intl/intl_data.h +++ b/ext/intl/intl_data.h @@ -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)) ); \ |