From: George Rhoten Date: Wed, 30 Apr 2014 18:34:36 +0000 (+0000) Subject: ICU-10871 Remove the old untested and unlisted U_PF_CLASSIC_MACOS platform. The moder... X-Git-Tag: milestone-59-0-1~1933 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cdf346b5eac1da155f5708c44bcdc73f1d37d1c;p=icu ICU-10871 Remove the old untested and unlisted U_PF_CLASSIC_MACOS platform. The modern ICU probably would not compile on this old platform anymore. X-SVN-Rev: 35663 --- diff --git a/icu4c/source/common/putil.cpp b/icu4c/source/common/putil.cpp index b7e2647d112..388b6aabed0 100644 --- a/icu4c/source/common/putil.cpp +++ b/icu4c/source/common/putil.cpp @@ -87,14 +87,6 @@ # include # include /* EPT_CALL macro - this include must be after all other "QSYSINCs" */ # include /* For uprv_maximumPtr */ -#elif U_PLATFORM == U_PF_CLASSIC_MACOS -# include -# include -# include -# include -# include -# include -# define ICU_NO_USER_DATA_OVERRIDE 1 #elif U_PLATFORM == U_PF_OS390 # include "unicode/ucnv.h" /* Needed for UCNV_SWAP_LFNL_OPTION_STRING */ #elif U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD || U_PLATFORM == U_PF_SOLARIS @@ -187,7 +179,7 @@ static const BitPatternConversion gInf = { (int64_t) INT64_C(0x7FF0000000000000) functions). ---------------------------------------------------------------------------*/ -#if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CLASSIC_MACOS || U_PLATFORM == U_PF_OS400 +#if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_OS400 # undef U_POSIX_LOCALE #else # define U_POSIX_LOCALE 1 @@ -306,21 +298,7 @@ uprv_getUTCtime() U_CAPI UDate U_EXPORT2 uprv_getRawUTCtime() { -#if U_PLATFORM == U_PF_CLASSIC_MACOS - time_t t, t1, t2; - struct tm tmrec; - - uprv_memset( &tmrec, 0, sizeof(tmrec) ); - tmrec.tm_year = 70; - tmrec.tm_mon = 0; - tmrec.tm_mday = 1; - t1 = mktime(&tmrec); /* seconds of 1/1/1970*/ - - time(&t); - uprv_memcpy( &tmrec, gmtime(&t), sizeof(tmrec) ); - t2 = mktime(&tmrec); /* seconds of current GMT*/ - return (UDate)(t2 - t1) * U_MILLIS_PER_SECOND; /* GMT (or UTC) in seconds since 1970*/ -#elif U_PLATFORM_USES_ONLY_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API FileTimeConversion winTime; GetSystemTimeAsFileTime(&winTime.fileTime); @@ -1297,115 +1275,6 @@ u_getDataDirectory(void) { return gDataDirectory; } - - - - -/* Macintosh-specific locale information ------------------------------------ */ -#if U_PLATFORM == U_PF_CLASSIC_MACOS - -typedef struct { - int32_t script; - int32_t region; - int32_t lang; - int32_t date_region; - const char* posixID; -} mac_lc_rec; - -/* Todo: This will be updated with a newer version from www.unicode.org web - page when it's available.*/ -#define MAC_LC_MAGIC_NUMBER -5 -#define MAC_LC_INIT_NUMBER -9 - -static const mac_lc_rec mac_lc_recs[] = { - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 0, "en_US", - /* United States*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 1, "fr_FR", - /* France*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 2, "en_GB", - /* Great Britain*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 3, "de_DE", - /* Germany*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 4, "it_IT", - /* Italy*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 5, "nl_NL", - /* Metherlands*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 6, "fr_BE", - /* French for Belgium or Lxembourg*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 7, "sv_SE", - /* Sweden*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 9, "da_DK", - /* Denmark*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 10, "pt_PT", - /* Portugal*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 11, "fr_CA", - /* French Canada*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 13, "is_IS", - /* Israel*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 14, "ja_JP", - /* Japan*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 15, "en_AU", - /* Australia*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 16, "ar_AE", - /* the Arabic world (?)*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 17, "fi_FI", - /* Finland*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 18, "fr_CH", - /* French for Switzerland*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 19, "de_CH", - /* German for Switzerland*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 20, "el_GR", - /* Greece*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 21, "is_IS", - /* Iceland ===*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 22, "",*/ - /* Malta ===*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 23, "",*/ - /* Cyprus ===*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 24, "tr_TR", - /* Turkey ===*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 25, "sh_YU", - /* Croatian system for Yugoslavia*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 33, "",*/ - /* Hindi system for India*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 34, "",*/ - /* Pakistan*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 41, "lt_LT", - /* Lithuania*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 42, "pl_PL", - /* Poland*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 43, "hu_HU", - /* Hungary*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 44, "et_EE", - /* Estonia*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 45, "lv_LV", - /* Latvia*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 46, "",*/ - /* Lapland [Ask Rich for the data. HS]*/ - /*MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 47, "",*/ - /* Faeroe Islands*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 48, "fa_IR", - /* Iran*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 49, "ru_RU", - /* Russia*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 50, "en_IE", - /* Ireland*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 51, "ko_KR", - /* Korea*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 52, "zh_CN", - /* People's Republic of China*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 53, "zh_TW", - /* Taiwan*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, 54, "th_TH", - /* Thailand*/ - - /* fallback is en_US*/ - MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, MAC_LC_MAGIC_NUMBER, - MAC_LC_MAGIC_NUMBER, "en_US" -}; - -#endif - #if U_POSIX_LOCALE /* A helper function used by uprv_getPOSIXIDForDefaultLocale and * uprv_getPOSIXIDForDefaultCodepage. Returns the posix locale id for @@ -1641,41 +1510,6 @@ The leftmost codepage (.xxx) wins. } return gCorrectedPOSIXLocale; -#elif U_PLATFORM == U_PF_CLASSIC_MACOS - int32_t script = MAC_LC_INIT_NUMBER; - /* = IntlScript(); or GetScriptManagerVariable(smSysScript);*/ - int32_t region = MAC_LC_INIT_NUMBER; - /* = GetScriptManagerVariable(smRegionCode);*/ - int32_t lang = MAC_LC_INIT_NUMBER; - /* = GetScriptManagerVariable(smScriptLang);*/ - int32_t date_region = MAC_LC_INIT_NUMBER; - const char* posixID = 0; - int32_t count = sizeof(mac_lc_recs) / sizeof(mac_lc_rec); - int32_t i; - Intl1Hndl ih; - - ih = (Intl1Hndl) GetIntlResource(1); - if (ih) - date_region = ((uint16_t)(*ih)->intl1Vers) >> 8; - - for (i = 0; i < count; i++) { - if ( ((mac_lc_recs[i].script == MAC_LC_MAGIC_NUMBER) - || (mac_lc_recs[i].script == script)) - && ((mac_lc_recs[i].region == MAC_LC_MAGIC_NUMBER) - || (mac_lc_recs[i].region == region)) - && ((mac_lc_recs[i].lang == MAC_LC_MAGIC_NUMBER) - || (mac_lc_recs[i].lang == lang)) - && ((mac_lc_recs[i].date_region == MAC_LC_MAGIC_NUMBER) - || (mac_lc_recs[i].date_region == date_region)) - ) - { - posixID = mac_lc_recs[i].posixID; - break; - } - } - - return posixID; - #elif U_PLATFORM == U_PF_OS400 /* locales are process scoped and are by definition thread safe */ static char correctedLocale[64]; @@ -1957,9 +1791,6 @@ int_getDefaultCodepage() return codepage; -#elif U_PLATFORM == U_PF_CLASSIC_MACOS - return "macintosh"; /* TODO: Macintosh Roman. There must be a better way. fixme! */ - #elif U_PLATFORM_USES_ONLY_WIN32_API static char codepage[64]; sprintf(codepage, "windows-%d", GetACP()); diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 1b2ab306ea3..07dce8adf07 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 1997-2013, International Business Machines +* Copyright (C) 1997-2014, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -123,8 +123,6 @@ #define U_PF_LINUX 4000 /** Android is based on Linux. @internal */ #define U_PF_ANDROID 4050 -/** "Classic" Mac OS (1984-2001) @internal */ -#define U_PF_CLASSIC_MACOS 8000 /** z/OS is the successor to OS/390 which was the successor to MVS. @internal */ #define U_PF_OS390 9000 /** "IBM i" is the current name of what used to be i5/OS and earlier OS/400. @internal */ @@ -169,8 +167,6 @@ # define U_PLATFORM U_PF_HPUX #elif defined(sgi) || defined(__sgi) # define U_PLATFORM U_PF_IRIX -#elif defined(macintosh) -# define U_PLATFORM U_PF_CLASSIC_MACOS #elif defined(__QNX__) || defined(__QNXNTO__) # define U_PLATFORM U_PF_QNX #elif defined(__TOS_MVS__) @@ -230,7 +226,7 @@ */ #ifdef U_PLATFORM_IMPLEMENTS_POSIX /* Use the predefined value. */ -#elif U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CLASSIC_MACOS +#elif U_PLATFORM_USES_ONLY_WIN32_API # define U_PLATFORM_IMPLEMENTS_POSIX 0 #else # define U_PLATFORM_IMPLEMENTS_POSIX 1 @@ -579,7 +575,7 @@ */ #ifdef U_SIZEOF_WCHAR_T /* Use the predefined value. */ -#elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9) || U_PLATFORM == U_PF_CLASSIC_MACOS +#elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9) /* * Classic Mac OS and Mac OS X before 10.3 (Panther) did not support wchar_t or wstring. * Newer Mac OS X has size 4. diff --git a/icu4c/source/common/unicode/putil.h b/icu4c/source/common/unicode/putil.h index 6fc7e9cd5a6..a67f27e467e 100644 --- a/icu4c/source/common/unicode/putil.h +++ b/icu4c/source/common/unicode/putil.h @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 1997-2011, International Business Machines +* Copyright (C) 1997-2014, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -93,14 +93,7 @@ U_STABLE void U_EXPORT2 u_setDataDirectory(const char *directory); * Example: '/' and ':' on Unix, '\\' and ';' on Windows. * @stable ICU 2.0 */ -#if U_PLATFORM == U_PF_CLASSIC_MACOS -# define U_FILE_SEP_CHAR ':' -# define U_FILE_ALT_SEP_CHAR ':' -# define U_PATH_SEP_CHAR ';' -# define U_FILE_SEP_STRING ":" -# define U_FILE_ALT_SEP_STRING ":" -# define U_PATH_SEP_STRING ";" -#elif U_PLATFORM_USES_ONLY_WIN32_API +#if U_PLATFORM_USES_ONLY_WIN32_API # define U_FILE_SEP_CHAR '\\' # define U_FILE_ALT_SEP_CHAR '/' # define U_PATH_SEP_CHAR ';'