diff options
author | Anatol Belski <ab@php.net> | 2018-03-31 18:51:03 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-03-31 18:51:56 +0200 |
commit | 8d35a423838eb462cd39ee535c5d003073cc5f22 (patch) | |
tree | baf326dd800f1521f62bcbc5b1b1106cc0c9e76b | |
parent | cad2a0f9c3f07b79269c49db491d7855ac13b4d2 (diff) | |
download | php-git-8d35a423838eb462cd39ee535c5d003073cc5f22.tar.gz |
Utilize the recommended way to handle the icu namespace
21 files changed, 66 insertions, 0 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 355072dec5..5d42e671b5 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -38,6 +38,7 @@ extern "C" { } using PHP::CodePointBreakIterator; +using U_ICU_NAMESPACE::RuleBasedBreakIterator; /* {{{ Global variables */ zend_class_entry *BreakIterator_ce_ptr; diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h index d1b5ebb2c8..9032f6f90f 100644 --- a/ext/intl/breakiterator/breakiterator_class.h +++ b/ext/intl/breakiterator/breakiterator_class.h @@ -26,6 +26,8 @@ #ifndef USE_BREAKITERATOR_POINTER typedef void BreakIterator; +#else +using U_ICU_NAMESPACE::BreakIterator; #endif typedef struct { diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index 0363198f06..1a91954469 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -32,6 +32,8 @@ extern "C" { } using PHP::CodePointBreakIterator; +using U_ICU_NAMESPACE::BreakIterator; +using U_ICU_NAMESPACE::Locale; U_CFUNC PHP_METHOD(BreakIterator, __construct) { diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp index 723cfd5022..1b6339cd6e 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.cpp +++ b/ext/intl/breakiterator/codepointiterator_internal.cpp @@ -33,6 +33,8 @@ typedef union { using namespace PHP; +using U_ICU_NAMESPACE::UCharCharacterIterator; + UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator); CodePointBreakIterator::CodePointBreakIterator() diff --git a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h index d34fc0a2c2..d8633516d8 100644 --- a/ext/intl/breakiterator/codepointiterator_internal.h +++ b/ext/intl/breakiterator/codepointiterator_internal.h @@ -18,8 +18,11 @@ #define CODEPOINTITERATOR_INTERNAL_H #include <unicode/brkiter.h> +#include <unicode/unistr.h> using U_ICU_NAMESPACE::BreakIterator; +using U_ICU_NAMESPACE::CharacterIterator; +using U_ICU_NAMESPACE::UnicodeString; namespace PHP { diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 8ab8194b17..b0fe87eda5 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -26,6 +26,9 @@ extern "C" { #include "../intl_convertcpp.h" #include "../intl_common.h" +using U_ICU_NAMESPACE::RuleBasedBreakIterator; +using U_ICU_NAMESPACE::Locale; + static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) { return (RuleBasedBreakIterator*)bio->biter; } diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 5c67051d84..4a641d967c 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -34,6 +34,9 @@ extern "C" { #include <assert.h> } +using U_ICU_NAMESPACE::GregorianCalendar; +using U_ICU_NAMESPACE::Locale; + /* {{{ Global variables */ zend_class_entry *Calendar_ce_ptr; zend_class_entry *GregorianCalendar_ce_ptr; diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h index a884580a9a..3202f672a5 100644 --- a/ext/intl/calendar/calendar_class.h +++ b/ext/intl/calendar/calendar_class.h @@ -26,6 +26,8 @@ #ifndef USE_CALENDAR_POINTER typedef void Calendar; +#else +using U_ICU_NAMESPACE::Calendar; #endif typedef struct { diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index 8183ab175c..0f450c737d 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -43,6 +43,8 @@ extern "C" { } #include "../common/common_enum.h" +using U_ICU_NAMESPACE::Locale; + U_CFUNC PHP_METHOD(IntlCalendar, __construct) { zend_throw_exception( NULL, diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index ab8ab76796..33f0cb0c8e 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -23,6 +23,8 @@ #include <unicode/locid.h> #include <unicode/calendar.h> #include <unicode/gregocal.h> +#include <unicode/ustring.h> + extern "C" { #include "../php_intl.h" #include "../intl_common.h" @@ -34,6 +36,11 @@ extern "C" { #include "zend_exceptions.h" } +using U_ICU_NAMESPACE::GregorianCalendar; +using U_ICU_NAMESPACE::Locale; +using U_ICU_NAMESPACE::UnicodeString; +using U_ICU_NAMESPACE::StringPiece; + static inline GregorianCalendar *fetch_greg(Calendar_object *co) { return (GregorianCalendar*)co->ucal; } diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index bd2baee776..2e8e296472 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -25,6 +25,9 @@ extern "C" { #include <ext/date/php_date.h> } +using U_ICU_NAMESPACE::TimeZone; +using U_ICU_NAMESPACE::UnicodeString; + #include "zend_portability.h" /* {{{ timezone_convert_datetimezone diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h index d6b7c20719..5ed0200232 100644 --- a/ext/intl/common/common_date.h +++ b/ext/intl/common/common_date.h @@ -28,6 +28,8 @@ U_CDECL_END #include <unicode/timezone.h> +using U_ICU_NAMESPACE::TimeZone; + U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func); U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, intl_error *err, const char *func); diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h index b9b87c17e0..41c102a5b1 100644 --- a/ext/intl/common/common_enum.h +++ b/ext/intl/common/common_enum.h @@ -75,6 +75,7 @@ U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter); U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter); #ifdef __cplusplus +using U_ICU_NAMESPACE::StringEnumeration; U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object); #endif diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp index e96ebe8243..d0010fc856 100644 --- a/ext/intl/dateformat/dateformat_format_object.cpp +++ b/ext/intl/dateformat/dateformat_format_object.cpp @@ -33,6 +33,12 @@ extern "C" { #include "../common/common_date.h" } +using U_ICU_NAMESPACE::Locale; +using U_ICU_NAMESPACE::DateFormat; +using U_ICU_NAMESPACE::GregorianCalendar; +using U_ICU_NAMESPACE::StringPiece; +using U_ICU_NAMESPACE::SimpleDateFormat; + static const DateFormat::EStyle valid_styles[] = { DateFormat::kNone, DateFormat::kFull, diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp index 959afa8d82..3caf59a309 100644 --- a/ext/intl/dateformat/dateformat_helpers.cpp +++ b/ext/intl/dateformat/dateformat_helpers.cpp @@ -28,6 +28,8 @@ extern "C" { #include "../calendar/calendar_class.h" } +using U_ICU_NAMESPACE::GregorianCalendar; + int datefmt_process_calendar_arg(zval* calendar_zv, Locale const& locale, const char *func_name, diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h index eb90c99169..162c35abfb 100644 --- a/ext/intl/dateformat/dateformat_helpers.h +++ b/ext/intl/dateformat/dateformat_helpers.h @@ -22,11 +22,16 @@ #endif #include <unicode/calendar.h> +#include <unicode/datefmt.h> extern "C" { #include "../php_intl.h" } +using U_ICU_NAMESPACE::Locale; +using U_ICU_NAMESPACE::Calendar; +using U_ICU_NAMESPACE::DateFormat; + int datefmt_process_calendar_arg(zval* calendar_zv, Locale const& locale, const char *func_name, diff --git a/ext/intl/intl_convertcpp.h b/ext/intl/intl_convertcpp.h index eab5f149c8..e3c53d7a56 100644 --- a/ext/intl/intl_convertcpp.h +++ b/ext/intl/intl_convertcpp.h @@ -26,6 +26,8 @@ #include <unicode/unistr.h> #include <zend_types.h> +using U_ICU_NAMESPACE::UnicodeString; + int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status); zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status); diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 5f39b34090..5a45398dce 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -76,6 +76,16 @@ MessageFormatAdapter::getMessagePattern(MessageFormat* m) { #endif U_NAMESPACE_END +using U_ICU_NAMESPACE::Formattable; +using U_ICU_NAMESPACE::Format; +using U_ICU_NAMESPACE::DateFormat; +using U_ICU_NAMESPACE::MessageFormat; +#ifdef HAS_MESSAGE_PATTERN +using U_ICU_NAMESPACE::MessagePattern; +#endif +using U_ICU_NAMESPACE::MessageFormatAdapter; +using U_ICU_NAMESPACE::FieldPosition; + U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt) { int32_t fmt_count = 0; diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 223fad06b7..d3038504f6 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -37,6 +37,8 @@ extern "C" { #include <ext/date/php_date.h> } +using U_ICU_NAMESPACE::Calendar; + /* {{{ Global variables */ U_CDECL_BEGIN zend_class_entry *TimeZone_ce_ptr = NULL; diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h index 0667c78994..d6c45a46f1 100644 --- a/ext/intl/timezone/timezone_class.h +++ b/ext/intl/timezone/timezone_class.h @@ -29,6 +29,8 @@ #ifndef USE_TIMEZONE_POINTER typedef void TimeZone; +#else +using U_ICU_NAMESPACE::TimeZone; #endif typedef struct { diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index d1cf6f58f2..abf4548d27 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -23,6 +23,7 @@ #include <unicode/locid.h> #include <unicode/timezone.h> #include <unicode/ustring.h> +#include <unicode/calendar.h> #include "intl_convertcpp.h" #include "../common/common_date.h" @@ -37,6 +38,9 @@ extern "C" { } #include "common/common_enum.h" +using U_ICU_NAMESPACE::Locale; +using U_ICU_NAMESPACE::Calendar; + U_CFUNC PHP_METHOD(IntlTimeZone, __construct) { zend_throw_exception( NULL, |