summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat')
-rw-r--r--ext/intl/msgformat/msgformat.c11
-rw-r--r--ext/intl/msgformat/msgformat_attr.c9
-rw-r--r--ext/intl/msgformat/msgformat_class.c11
-rw-r--r--ext/intl/msgformat/msgformat_class.h4
-rw-r--r--ext/intl/msgformat/msgformat_data.c10
-rw-r--r--ext/intl/msgformat/msgformat_format.c9
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp36
-rw-r--r--ext/intl/msgformat/msgformat_parse.c9
8 files changed, 2 insertions, 97 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 3f5af5fd67..2439b5855a 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -113,7 +113,7 @@ PHP_METHOD( MessageFormatter, __construct )
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
- return_value = getThis();
+ return_value = ZEND_THIS;
if (msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);
@@ -178,12 +178,3 @@ PHP_FUNCTION( msgfmt_get_error_message )
RETURN_STR(message);
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index 78eb727c61..51d9df049f 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -140,12 +140,3 @@ PHP_FUNCTION( msgfmt_get_locale )
RETURN_STRING(loc);
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 8501a2fe65..a6d5b593a6 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -125,7 +125,7 @@ ZEND_END_ARG_INFO()
* Every 'MessageFormatter' class method has an entry in this table
*/
static const zend_function_entry MessageFormatter_class_functions[] = {
- PHP_ME( MessageFormatter, __construct, arginfo_messageformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+ PHP_ME( MessageFormatter, __construct, arginfo_messageformatter___construct, ZEND_ACC_PUBLIC )
ZEND_FENTRY( create, ZEND_FN( msgfmt_create ), arginfo_messageformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_NAMED_FE( format, ZEND_FN( msgfmt_format ), arginfo_messageformatter_format )
ZEND_FENTRY( formatMessage, ZEND_FN( msgfmt_format_message ), arginfo_messageformatter_formatmessage, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
@@ -159,12 +159,3 @@ void msgformat_register_class( void )
MessageFormatter_handlers.free_obj = MessageFormatter_object_free;
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 6823595f6d..51025f0671 100644
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -25,10 +25,6 @@
#include "../intl_error.h"
#include "../intl_data.h"
-#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
-# define MSG_FORMAT_QUOTE_APOS 1
-#endif
-
#include "msgformat_data.h"
typedef struct {
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index e2510e16b8..03dc232f67 100644
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -98,13 +98,3 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e
return SUCCESS;
}
#endif
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index e833781c79..a11c167a4b 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -148,12 +148,3 @@ PHP_FUNCTION( msgfmt_format_message )
msgformat_data_free(&mfo->mf_data);
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index f8e3273f5d..dcc74283b2 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -44,11 +44,6 @@ extern "C" {
#include "../timezone/timezone_class.h"
}
-#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
-#define HAS_MESSAGE_PATTERN 1
-#define HAS_MISALLOCATE_MEMORY_BUG 1
-#endif
-
U_NAMESPACE_BEGIN
/**
* This class isolates our access to private internal methods of
@@ -59,9 +54,7 @@ class MessageFormatAdapter {
public:
static const Formattable::Type* getArgTypeList(const MessageFormat& m,
int32_t& count);
-#ifdef HAS_MESSAGE_PATTERN
static const MessagePattern getMessagePattern(MessageFormat* m);
-#endif
};
const Formattable::Type*
@@ -70,21 +63,17 @@ MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
return m.getArgTypeList(count);
}
-#ifdef HAS_MESSAGE_PATTERN
const MessagePattern
MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
return m->msgPattern;
}
-#endif
U_NAMESPACE_END
using icu::Formattable;
using icu::Format;
using icu::DateFormat;
using icu::MessageFormat;
-#ifdef HAS_MESSAGE_PATTERN
using icu::MessagePattern;
-#endif
using icu::MessageFormatAdapter;
using icu::FieldPosition;
@@ -139,7 +128,6 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
return ret;
}
-#ifdef HAS_MESSAGE_PATTERN
static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
const MessagePattern& mp,
intl_error& err)
@@ -266,10 +254,8 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
type = Formattable::kDouble;
} else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
type = Formattable::kString;
-#if U_ICU_VERSION_MAJOR_NUM >= 50
} else if (argType == UMSGPAT_ARG_TYPE_SELECTORDINAL) {
type = Formattable::kDouble;
-#endif
} else {
type = Formattable::kString;
}
@@ -296,26 +282,15 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
return ret;
}
-#endif
static HashTable *umsg_get_types(MessageFormatter_object *mfo,
intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
-#ifdef HAS_MESSAGE_PATTERN
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
return umsg_parse_format(mfo, mp, err);
-#else
- if (mf->usesNamedArguments()) {
- intl_errors_set(&err, U_UNSUPPORTED_ERROR,
- "This extension supports named arguments only on ICU 4.8+",
- 0);
- return NULL;
- }
- return umsg_get_numeric_types(mfo, err);
-#endif
}
static void umsg_set_timezone(MessageFormatter_object *mfo,
@@ -335,7 +310,6 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
return; /* already done */
}
-#ifdef HAS_MISALLOCATE_MEMORY_BUG
/* There is a bug in ICU which prevents MessageFormatter::getFormats()
to handle more than 10 formats correctly. The enumerator could be
used to walk through the present formatters using getFormat(), which
@@ -353,7 +327,6 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (count > 10) {
return;
}
-#endif
formats = mf->getFormats(count);
@@ -702,12 +675,3 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh
}
delete[] fargs;
}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index 8562a76e92..c517288bff 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -152,12 +152,3 @@ PHP_FUNCTION( msgfmt_parse_message )
msgformat_data_free(&mfo->mf_data);
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */