Skip to content

Commit e7e3deb

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80425
2 parents f131234 + c61390c commit e7e3deb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

ext/intl/msgformat/msgformat_helpers.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,26 @@ extern "C" {
4343

4444
U_NAMESPACE_BEGIN
4545
/**
46-
* This class isolates our access to private internal methods of
47-
* MessageFormat. It is never instantiated; it exists only for C++
48-
* access management.
46+
* ICU declares MessageFormatAdapter as a friend class of MessageFormat,
47+
* to use as a backdoor for accessing private MessageFormat members.
48+
* We use it for the same purpose here. Prefix the methods with php to
49+
* avoid clashes with any definitions in ICU.
4950
*/
5051
class MessageFormatAdapter {
5152
public:
52-
static const Formattable::Type* getArgTypeList(const MessageFormat& m,
53+
static const Formattable::Type* phpGetArgTypeList(const MessageFormat& m,
5354
int32_t& count);
54-
static const MessagePattern getMessagePattern(MessageFormat* m);
55+
static const MessagePattern phpGetMessagePattern(MessageFormat* m);
5556
};
5657

5758
const Formattable::Type*
58-
MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
59+
MessageFormatAdapter::phpGetArgTypeList(const MessageFormat& m,
5960
int32_t& count) {
6061
return m.getArgTypeList(count);
6162
}
6263

6364
const MessagePattern
64-
MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
65+
MessageFormatAdapter::phpGetMessagePattern(MessageFormat* m) {
6566
return m->msgPattern;
6667
}
6768
U_NAMESPACE_END
@@ -77,7 +78,7 @@ using icu::FieldPosition;
7778
U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
7879
{
7980
int32_t fmt_count = 0;
80-
MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
81+
MessageFormatAdapter::phpGetArgTypeList(*(const MessageFormat*)fmt, fmt_count);
8182
return fmt_count;
8283
}
8384

@@ -100,7 +101,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
100101
return mfo->mf_data.arg_types;
101102
}
102103

103-
const Formattable::Type *types = MessageFormatAdapter::getArgTypeList(
104+
const Formattable::Type *types = MessageFormatAdapter::phpGetArgTypeList(
104105
*(MessageFormat*)mfo->mf_data.umsgf, parts_count);
105106

106107
/* Hash table will store Formattable::Type objects directly,
@@ -285,7 +286,7 @@ static HashTable *umsg_get_types(MessageFormatter_object *mfo,
285286
{
286287
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
287288

288-
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
289+
const MessagePattern mp = MessageFormatAdapter::phpGetMessagePattern(mf);
289290

290291
return umsg_parse_format(mfo, mp, err);
291292
}

0 commit comments

Comments
 (0)