obj = (oclass##_object *) zend_object_store_get_object( object TSRMLS_CC ); \
intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \
-// Check status by error code, if error - exit
+/* Check status by error code, if error - exit */
#define INTL_CHECK_STATUS(err, msg) \
intl_error_set_code( NULL, (err) TSRMLS_CC ); \
if( U_FAILURE((err)) ) \
{ \
- intl_errors_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \
+ intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \
RETURN_FALSE; \
}
RETURN_FALSE; \
}
-#define INTL_MAX_LOCALE_LEN 64
+#define INTL_MAX_LOCALE_LEN 80
-// Check status, if error - destroy value and exit
+/* Check status, if error - destroy value and exit */
#define INTL_CTOR_CHECK_STATUS(obj, msg) \
intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
#define INTL_CHECK_LOCALE_LEN(locale_len) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 64 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
RETURN_NULL(); \
}
#define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 64 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
zval_dtor(object); \
ZVAL_NULL(object); \
RETURN_NULL(); \
*/
void intl_errors_reset( intl_error* err TSRMLS_DC )
{
- intl_error_reset( err TSRMLS_CC );
+ if(err) {
+ intl_error_reset( err TSRMLS_CC );
+ }
intl_error_reset( NULL TSRMLS_CC );
}
/* }}} */
*/
void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
{
- intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ if(err) {
+ intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ }
intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC );
}
/* }}} */
*/
void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
{
- intl_error_set_code( err, err_code TSRMLS_CC );
+ if(err) {
+ intl_error_set_code( err, err_code TSRMLS_CC );
+ }
intl_error_set_code( NULL, err_code TSRMLS_CC );
}
/* }}} */