]> granicus.if.org Git - icu/commitdiff
ICU-8573 remove support for U_IOSTREAM_SOURCE=198506
authorMarkus Scherer <markus.icu@gmail.com>
Tue, 5 Jul 2011 23:42:32 +0000 (23:42 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Tue, 5 Jul 2011 23:42:32 +0000 (23:42 +0000)
X-SVN-Rev: 30278

icu4c/source/common/unicode/platform.h.in
icu4c/source/common/unistr.cpp
icu4c/source/i18n/fmtable.cpp
icu4c/source/io/unicode/ustream.h
icu4c/source/io/ustream.cpp
icu4c/source/test/intltest/tmsgfmt.cpp
icu4c/source/test/intltest/ustrtest.cpp
icu4c/source/test/iotest/iotest.cpp
icu4c/source/test/iotest/stream.cpp

index 466c8cae7c2a3abba190ada11d24bbb6c0198645..9e9bfadcd2fc9d0bd312bfd7bbda4140b54114b2 100644 (file)
 
 /**
  * Define what support for C++ streams is available.
- *     If U_IOSTREAM_SOURCE is set to 199711, then &lt;iostream&gt; is available
- * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
+ *
+ * If U_IOSTREAM_SOURCE is set to 199711, then &lt;iostream&gt; 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 &lt;iostream.h&gt; 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 &lt;iostream.h&gt; 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
 
 /**
index 3df71d75415f9b3732cde9ab78ec01d182742d9f..979ffe3e14a316161a839eb201e9654305486cf2 100644 (file)
 
 #if 0
 
-#if U_IOSTREAM_SOURCE >= 199711
 #include <iostream>
 using namespace std;
-#elif U_IOSTREAM_SOURCE >= 198506
-#include <iostream.h>
-#endif
 
 //DEBUGGING
 void
index 685fe2139ccdccbb1332b598446606b5ac644960..b28bf6a3f2b27d4fb38f16667689c17250fff993 100644 (file)
@@ -787,12 +787,8 @@ Formattable::setDecimalNumber(const StringPiece &numberString, UErrorCode &statu
 //----------------------------------------------------
 #ifdef _DEBUG
 
-#if U_IOSTREAM_SOURCE >= 199711
 #include <iostream>
 using namespace std;
-#elif U_IOSTREAM_SOURCE >= 198506
-#include <iostream.h>
-#endif
 
 #include "unicode/datefmt.h"
 #include "unistrm.h"
index 368a29ed6758f75dd5aeec7e1782efa6560fe08c..abd24388697bcdb1361c663df65c9ec1771f05de 100644 (file)
@@ -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
-/* <istream.h> and <ostream.h> don't exist. */
-#include <iostream.h>
-
-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  */
index 3fd6237d129a971a3fe535b0d147c7132619c6ac..b3d0af41e4b67eafd845e1bbd8566b90aaa3e73f 100644 (file)
@@ -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"
 
 // 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
-
index e32f27595077823d9f5272b4542b9872794adf9e..dff738538f2733b0a7db23855d976104f2e70963 100644 (file)
@@ -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 <iostream>
-    std::ostream& operator<<(std::ostream& stream,  const Formattable&   obj);
-#elif U_IOSTREAM_SOURCE >= 198506
-#   include <iostream.h>
-    ostream& operator<<(ostream& stream,  const Formattable&   obj);
-#endif
+#include <iostream>
+std::ostream& operator<<(std::ostream& stream,  const Formattable&   obj);
 
 #include "unicode/datefmt.h"
 #include <stdlib.h>
@@ -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() 
index 62e3884b82b80c9538a91ad9f2bf290752cfa9b2..f1cd4b55d7da00155a553fe9a34778cee4544c14 100644 (file)
 #if 0
 #include "unicode/ustream.h"
 
-#if U_IOSTREAM_SOURCE >= 199711
 #include <iostream>
 using namespace std;
-#elif U_IOSTREAM_SOURCE >= 198506
-#include <iostream.h>
-#endif
 
 #endif
 
index 407e2014c560ff38713abdc7a20eff256dd45e15..84d3543925484bb916e9403105faf5657b9b0afa 100644 (file)
@@ -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
 }
index 8fb3cf5adfb7ba7d6524b2bcdd65f8d043e96705..794da82a409f5f77d8d3705a88772f5735aaeebe 100644 (file)
@@ -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
 #include <fstream>
 #include <iomanip>
 using namespace std;
-#elif U_IOSTREAM_SOURCE >= 198506
-#define USE_OLD_IOSTREAM 1
-#include <strstream.h>
-#include <fstream.h>
-#endif
 
 #include <string.h>
 
@@ -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";