From: Markus Scherer Date: Tue, 5 Jul 2011 23:42:32 +0000 (+0000) Subject: ICU-8573 remove support for U_IOSTREAM_SOURCE=198506 X-Git-Tag: milestone-59-0-1~4681 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=493668a25f935baf7de2fc7f43880f7b5fd82211;p=icu ICU-8573 remove support for U_IOSTREAM_SOURCE=198506 X-SVN-Rev: 30278 --- diff --git a/icu4c/source/common/unicode/platform.h.in b/icu4c/source/common/unicode/platform.h.in index 466c8cae7c2..9e9bfadcd2f 100644 --- a/icu4c/source/common/unicode/platform.h.in +++ b/icu4c/source/common/unicode/platform.h.in @@ -69,20 +69,24 @@ /** * Define what support for C++ streams is available. - * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available - * (1997711 is the date the ISO/IEC C++ FDIS was published), and then + * + * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available + * (the ISO/IEC C++ FDIS was published in November 1997), and then * one should qualify streams using the std namespace in ICU header * files. - * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is - * available instead (198506 is the date when Stroustrup published + * Starting with ICU 49, this is the only supported version. + * + * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is + * available instead (in June 1985 Stroustrup published * "An Extensible I/O Facility for C++" at the summer USENIX conference). - * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and - * support for them will be silently suppressed in ICU. + * Starting with ICU 49, this version is not supported any more. * + * If U_IOSTREAM_SOURCE is 0 (or any value less than 199711), + * then C++ streams are not available and + * support for them will be silently suppressed in ICU. */ - #ifndef U_IOSTREAM_SOURCE -#define U_IOSTREAM_SOURCE @U_IOSTREAM_SOURCE@ +#define U_IOSTREAM_SOURCE 199711 #endif /** diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp index 3df71d75415..979ffe3e14a 100644 --- a/icu4c/source/common/unistr.cpp +++ b/icu4c/source/common/unistr.cpp @@ -31,12 +31,8 @@ #if 0 -#if U_IOSTREAM_SOURCE >= 199711 #include using namespace std; -#elif U_IOSTREAM_SOURCE >= 198506 -#include -#endif //DEBUGGING void diff --git a/icu4c/source/i18n/fmtable.cpp b/icu4c/source/i18n/fmtable.cpp index 685fe2139cc..b28bf6a3f2b 100644 --- a/icu4c/source/i18n/fmtable.cpp +++ b/icu4c/source/i18n/fmtable.cpp @@ -787,12 +787,8 @@ Formattable::setDecimalNumber(const StringPiece &numberString, UErrorCode &statu //---------------------------------------------------- #ifdef _DEBUG -#if U_IOSTREAM_SOURCE >= 199711 #include using namespace std; -#elif U_IOSTREAM_SOURCE >= 198506 -#include -#endif #include "unicode/datefmt.h" #include "unistrm.h" diff --git a/icu4c/source/io/unicode/ustream.h b/icu4c/source/io/unicode/ustream.h index 368a29ed675..abd24388697 100644 --- a/icu4c/source/io/unicode/ustream.h +++ b/icu4c/source/io/unicode/ustream.h @@ -54,29 +54,6 @@ U_IO_API std::ostream & U_EXPORT2 operator<<(std::ostream& stream, const Unicode U_IO_API std::istream & U_EXPORT2 operator>>(std::istream& stream, UnicodeString& s); U_NAMESPACE_END -#elif U_IOSTREAM_SOURCE >= 198506 -/* and don't exist. */ -#include - -U_NAMESPACE_BEGIN -/** - * Write the contents of a UnicodeString to a C++ ostream. This functions writes - * the characters in a UnicodeString to an ostream. The UChars in the - * UnicodeString are converted to the char based ostream with the default - * converter. - * @stable 3.0 - */ -U_IO_API ostream & U_EXPORT2 operator<<(ostream& stream, const UnicodeString& s); - -/** - * Write the contents from a C++ istream to a UnicodeString. The UChars in the - * UnicodeString are converted from the char based istream with the default - * converter. - * @stable 3.0 - */ -U_IO_API istream & U_EXPORT2 operator>>(istream& stream, UnicodeString& s); -U_NAMESPACE_END - #endif /* No operator for UChar because it can conflict with wchar_t */ diff --git a/icu4c/source/io/ustream.cpp b/icu4c/source/io/ustream.cpp index 3fd6237d129..b3d0af41e4b 100644 --- a/icu4c/source/io/ustream.cpp +++ b/icu4c/source/io/ustream.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2001-2010, International Business Machines +* Copyright (C) 2001-2011, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * FILE NAME : ustream.cpp @@ -12,7 +12,6 @@ ****************************************************************************** */ - #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/ustream.h" @@ -24,13 +23,9 @@ // console IO -#if U_IOSTREAM_SOURCE >= 198506 - #if U_IOSTREAM_SOURCE >= 199711 + #define STD_NAMESPACE std:: -#else -#define STD_NAMESPACE -#endif #define STD_OSTREAM STD_NAMESPACE ostream #define STD_ISTREAM STD_NAMESPACE istream @@ -169,4 +164,3 @@ STOP_READING: U_NAMESPACE_END #endif - diff --git a/icu4c/source/test/intltest/tmsgfmt.cpp b/icu4c/source/test/intltest/tmsgfmt.cpp index e32f2759507..dff738538f2 100644 --- a/icu4c/source/test/intltest/tmsgfmt.cpp +++ b/icu4c/source/test/intltest/tmsgfmt.cpp @@ -187,18 +187,13 @@ void TestMessageFormat::testBug2() } #if 0 -#if defined(_DEBUG) && U_IOSTREAM_SOURCE!=0 +#if defined(_DEBUG) && U_IOSTREAM_SOURCE >= 199711 //---------------------------------------------------- // console I/O //---------------------------------------------------- -#if U_IOSTREAM_SOURCE >= 199711 -# include - std::ostream& operator<<(std::ostream& stream, const Formattable& obj); -#elif U_IOSTREAM_SOURCE >= 198506 -# include - ostream& operator<<(ostream& stream, const Formattable& obj); -#endif +#include +std::ostream& operator<<(std::ostream& stream, const Formattable& obj); #include "unicode/datefmt.h" #include @@ -243,7 +238,7 @@ operator<<( IntlTest& stream, } return stream; } -#endif /* defined(_DEBUG) && U_IOSTREAM_SOURCE!=0 */ +#endif /* defined(_DEBUG) && U_IOSTREAM_SOURCE >= 199711 */ #endif void TestMessageFormat::PatternTest() diff --git a/icu4c/source/test/intltest/ustrtest.cpp b/icu4c/source/test/intltest/ustrtest.cpp index 62e3884b82b..f1cd4b55d7d 100644 --- a/icu4c/source/test/intltest/ustrtest.cpp +++ b/icu4c/source/test/intltest/ustrtest.cpp @@ -19,12 +19,8 @@ #if 0 #include "unicode/ustream.h" -#if U_IOSTREAM_SOURCE >= 199711 #include using namespace std; -#elif U_IOSTREAM_SOURCE >= 198506 -#include -#endif #endif diff --git a/icu4c/source/test/iotest/iotest.cpp b/icu4c/source/test/iotest/iotest.cpp index 407e2014c56..84d35439254 100644 --- a/icu4c/source/test/iotest/iotest.cpp +++ b/icu4c/source/test/iotest/iotest.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2010, International Business Machines +* Copyright (C) 2002-2011, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: iotest.cpp @@ -694,7 +694,7 @@ static void addAllTests(TestNode** root) { addTest(root, &DataDrivenPrintfPrecision, "datadriv/DataDrivenPrintfPrecision"); addTest(root, &DataDrivenScanf, "datadriv/DataDrivenScanf"); #endif -#if U_IOSTREAM_SOURCE +#if U_IOSTREAM_SOURCE >= 199711 addStreamTests(root); #endif } diff --git a/icu4c/source/test/iotest/stream.cpp b/icu4c/source/test/iotest/stream.cpp index 8fb3cf5adfb..794da82a409 100644 --- a/icu4c/source/test/iotest/stream.cpp +++ b/icu4c/source/test/iotest/stream.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 2002-2010, International Business Machines +* Copyright (C) 2002-2011, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: iotest.cpp @@ -31,11 +31,6 @@ #include #include using namespace std; -#elif U_IOSTREAM_SOURCE >= 198506 -#define USE_OLD_IOSTREAM 1 -#include -#include -#endif #include @@ -51,11 +46,9 @@ const char C_NEW_LINE[] = {'\n',0}; #endif U_CDECL_END -#if U_IOSTREAM_SOURCE U_CDECL_BEGIN static void U_CALLCONV TestStream(void) { -#if U_IOSTREAM_SOURCE >= 198506 const UChar thisMu[] = { 0x74, 0x48, 0x69, 0x73, 0x3BC, 0}; const UChar mu[] = { 0x6D, 0x75, 0}; UnicodeString str1 = UNICODE_STRING_SIMPLE("str1"); @@ -182,9 +175,6 @@ static void U_CALLCONV TestStream(void) log_err("Error converting string for large stream buffer testing.\n"); } ucnv_close(defConv); -#else - log_info("U_IOSTREAM_SOURCE is disabled\n"); -#endif } #define IOSTREAM_GOOD_SHIFT 3 @@ -248,12 +238,7 @@ testString( if (getBitStatus(sstrm) != expectedStatus) { printBits(sstrm); -#ifdef USE_OLD_IOSTREAM - log_info("Warning. Expected status %d, Got %d. This maybe caused by the fact that the non-standardized iostream is being used.\n", expectedStatus, getBitStatus(sstrm)); - log_info("See verbose output for details.\n"); -#else log_err("Expected status %d, Got %d. See verbose output for details\n", expectedStatus, getBitStatus(sstrm)); -#endif } if (str != UnicodeString(expectedString)) { log_err("Did not get expected results from \"%s\", expected \"%s\"\n", testString, expectedString); @@ -271,11 +256,6 @@ static void U_CALLCONV TestStreamEOF(void) strstream ss; #endif -#ifdef USE_OLD_IOSTREAM - log_info("Old non-standardized iostream being used. This may result in inconsistent state flag settings. (e.g. failbit may not be set properly)\n"); - log_info("In such a case, warnings will be issued instead of errors.\n"); -#endif - fs << "EXAMPLE"; fs.seekg(0); ss << "EXAMPLE";