| Index: third_party/icu/source/i18n/ucal.cpp
|
| ===================================================================
|
| --- third_party/icu/source/i18n/ucal.cpp (revision 74230)
|
| +++ third_party/icu/source/i18n/ucal.cpp (working copy)
|
| @@ -5,7 +5,6 @@
|
| *******************************************************************************
|
| */
|
|
|
| -#include <typeinfo> // for 'typeid' to work
|
|
|
| #include "unicode/utypes.h"
|
|
|
| @@ -85,7 +84,7 @@
|
| int32_t result = 0;
|
| TimeZone* zone = _createTimeZone(zoneID, -1, ec);
|
| if (U_SUCCESS(*ec)) {
|
| - SimpleTimeZone* stz = dynamic_cast<SimpleTimeZone*>(zone);
|
| + SimpleTimeZone* stz = CR_DYNAMIC_CAST<SimpleTimeZone*>(zone);
|
| if (stz != NULL) {
|
| result = stz->getDSTSavings();
|
| } else {
|
| @@ -247,11 +246,12 @@
|
| return;
|
| }
|
| Calendar *cpp_cal = (Calendar *)cal;
|
| - GregorianCalendar *gregocal = dynamic_cast<GregorianCalendar *>(cpp_cal);
|
| + GregorianCalendar *gregocal = CR_DYNAMIC_CAST<GregorianCalendar *>(cpp_cal);
|
| // Not if(gregocal == NULL) {
|
| // because we really want to work only with a GregorianCalendar, not with
|
| // its subclasses like BuddhistCalendar.
|
| - if(typeid(*cpp_cal) != typeid(GregorianCalendar)) {
|
| + // Blindly replacing typeid with CR_TYPEID does not work here.
|
| + if(CR_TYPEID(*cpp_cal) != GregorianCalendar::getStaticClassID()) {
|
| *pErrorCode = U_UNSUPPORTED_ERROR;
|
| return;
|
| }
|
| @@ -264,10 +264,11 @@
|
| return (UDate)0;
|
| }
|
| const Calendar *cpp_cal = (const Calendar *)cal;
|
| - const GregorianCalendar *gregocal = dynamic_cast<const GregorianCalendar *>(cpp_cal);
|
| + const GregorianCalendar *gregocal = CR_DYNAMIC_CAST<const GregorianCalendar *>(cpp_cal);
|
| // Not if(gregocal == NULL) {
|
| // see comments in ucal_setGregorianChange().
|
| - if(typeid(*cpp_cal) != typeid(GregorianCalendar)) {
|
| + // Blindly replacing typeid with CR_TYPEID does not work here.
|
| + if(CR_TYPEID(*cpp_cal) != GregorianCalendar::getStaticClassID()) {
|
| *pErrorCode = U_UNSUPPORTED_ERROR;
|
| return (UDate)0;
|
| }
|
|
|