]> granicus.if.org Git - php/commitdiff
Utilize the recommended way to handle the icu namespace
authorAnatol Belski <ab@php.net>
Sat, 31 Mar 2018 16:51:03 +0000 (18:51 +0200)
committerAnatol Belski <ab@php.net>
Sat, 31 Mar 2018 16:51:56 +0000 (18:51 +0200)
21 files changed:
ext/intl/breakiterator/breakiterator_class.cpp
ext/intl/breakiterator/breakiterator_class.h
ext/intl/breakiterator/breakiterator_methods.cpp
ext/intl/breakiterator/codepointiterator_internal.cpp
ext/intl/breakiterator/codepointiterator_internal.h
ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
ext/intl/calendar/calendar_class.cpp
ext/intl/calendar/calendar_class.h
ext/intl/calendar/calendar_methods.cpp
ext/intl/calendar/gregoriancalendar_methods.cpp
ext/intl/common/common_date.cpp
ext/intl/common/common_date.h
ext/intl/common/common_enum.h
ext/intl/dateformat/dateformat_format_object.cpp
ext/intl/dateformat/dateformat_helpers.cpp
ext/intl/dateformat/dateformat_helpers.h
ext/intl/intl_convertcpp.h
ext/intl/msgformat/msgformat_helpers.cpp
ext/intl/timezone/timezone_class.cpp
ext/intl/timezone/timezone_class.h
ext/intl/timezone/timezone_methods.cpp

index 355072dec5de8b5329859a2f9c5b9581630b9122..5d42e671b5781f6aed520d5eda5ba061d559e9d5 100644 (file)
@@ -38,6 +38,7 @@ extern "C" {
 }
 
 using PHP::CodePointBreakIterator;
+using U_ICU_NAMESPACE::RuleBasedBreakIterator;
 
 /* {{{ Global variables */
 zend_class_entry *BreakIterator_ce_ptr;
index d1b5ebb2c8a9e33ff5e383f8a9f5c09c0c4b8e34..9032f6f90f41ff3454789dae537983050d8d41f3 100644 (file)
@@ -26,6 +26,8 @@
 
 #ifndef USE_BREAKITERATOR_POINTER
 typedef void BreakIterator;
+#else
+using U_ICU_NAMESPACE::BreakIterator;
 #endif
 
 typedef struct {
index 0363198f0642eed63173ac3fc68b6095b61a02b0..1a9195446966a79e9ff344659c77e65ca5d2a6c9 100644 (file)
@@ -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)
 {
index 723cfd50220ce6aa4062665de1681def01c63822..1b6339cd6e9ef5502bdb5cab9cd8f3ad80801626 100644 (file)
@@ -33,6 +33,8 @@ typedef union {
 
 using namespace PHP;
 
+using U_ICU_NAMESPACE::UCharCharacterIterator;
+
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
 
 CodePointBreakIterator::CodePointBreakIterator()
index d34fc0a2c216488761642219d101aa233c2b12d3..d8633516d8a7be93dde8af193d8cb5ea54d6079a 100644 (file)
 #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 {
 
index 8ab8194b17ab7de6ea6d52ae1beec743ad286cff..b0fe87eda5e39ded9b6d0d4dce65b950eb3142c2 100644 (file)
@@ -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;
 }
index 5c67051d849985ddfb79d024042875c60314c963..4a641d967cb0b34070cfd2a086b3f61e952811d6 100644 (file)
@@ -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;
index a884580a9ab4d0c1d3b70e4f9c7a05aecd570895..3202f672a53a7f953e76a17924d9b11366b8f7e3 100644 (file)
@@ -26,6 +26,8 @@
 
 #ifndef USE_CALENDAR_POINTER
 typedef void Calendar;
+#else
+using U_ICU_NAMESPACE::Calendar;
 #endif
 
 typedef struct {
index 8183ab175c3fa4d121d3f3d96a718047a8a598de..0f450c737dea34dac03a60c6d0528e66f629fa68 100644 (file)
@@ -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,
index ab8ab767965b6ea4e4427a51f5e4d58eaa466446..33f0cb0c8e166a50e8d9d3e6ade29c8702d2f2ef 100644 (file)
@@ -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;
 }
index bd2baee7765aee0ca54f947c522be0a4a58ee181..2e8e296472e88c63404d671bb542ec41c4c2f12e 100644 (file)
@@ -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
index d6b7c207193133fa4d3c97bee78e5b6707e8c6e1..5ed02002328074b6fe9132ca9ca60ed49e16b08f 100644 (file)
@@ -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);
index b9b87c17e02292b587a6e006e85a4f32f7b4df45..41c102a5b1618b789692cb9cf76ba79ed5d2eba7 100644 (file)
@@ -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
 
index e96ebe8243ab382c601926c5b1ea8e4e5edcc42b..d0010fc856c91cc31d9cf7ea8c9eff35b9baee4a 100644 (file)
@@ -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,
index 959afa8d821975ca1eb50f669b2ac81adea2827a..3caf59a3091349c4831047f2063ed3920756f1d6 100644 (file)
@@ -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,
index eb90c991691b13d21ff59e3a84bcb49a07991b70..162c35abfb9b03a731c78fb5c3a55f24ceaabe36 100644 (file)
 #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,
index eab5f149c88264b735ceafdf637d70424bc5b55b..e3c53d7a5693ff4ea082c00af18b268584a088ee 100644 (file)
@@ -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);
index 5f39b34090f9190ec52e53ef1e7142fe475d4811..5a45398dcefb186d32e95c5e755b1444bdd50e53 100644 (file)
@@ -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;
index 223fad06b7a087a2e66f6cdc5c3606dae261153c..d3038504f6eb88a5c5dbad4df3ea5c931896884a 100644 (file)
@@ -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;
index 0667c78994bfd57ab758cd10ceb7e8a5522b88d1..d6c45a46f1dd66a3e152bd8953c58c30b0091a8d 100644 (file)
@@ -29,6 +29,8 @@
 
 #ifndef USE_TIMEZONE_POINTER
 typedef void TimeZone;
+#else
+using U_ICU_NAMESPACE::TimeZone;
 #endif
 
 typedef struct {
index d1cf6f58f2bf1a47e13bf09e048b716e1a6f22a5..abf4548d27aa19b16faf9622395956c516769deb 100644 (file)
@@ -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,