]> granicus.if.org Git - icu/commitdiff
ICU-12736 remove remaining uses of now-obsolete U_HAVE_STD_STRING
authorMarkus Scherer <markus.icu@gmail.com>
Sat, 4 Mar 2017 00:22:40 +0000 (00:22 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Sat, 4 Mar 2017 00:22:40 +0000 (00:22 +0000)
X-SVN-Rev: 39733

icu4c/source/Doxyfile.in
icu4c/source/common/unicode/bytestream.h
icu4c/source/common/unicode/platform.h
icu4c/source/common/uposixdefs.h
icu4c/source/configure.ac
icu4c/source/test/intltest/collationtest.cpp
icu4c/source/test/intltest/rbbiapts.cpp
icu4c/source/test/intltest/strcase.cpp
icu4c/source/test/intltest/uts46test.cpp
icu4c/source/tools/gennorm2/n2builder.cpp
icu4c/source/tools/toolutil/udbgutil.cpp

index fde612523db168761b24aa69eb5af353d489974a..8104be3a047fe8c4dca0116d07bdd363cf16f6ae 100644 (file)
@@ -194,7 +194,7 @@ EXPAND_ONLY_PREDEF     = YES
 SEARCH_INCLUDES        = YES
 INCLUDE_PATH           = 
 INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = U_EXPORT2= U_STABLE= U_DRAFT= U_INTERNAL= U_SYSTEM= U_DEPRECATED= U_OBSOLETE= U_CALLCONV= U_CDECL_BEGIN= U_CDECL_END=  U_NO_THROW=\ "U_NAMESPACE_BEGIN=namespace icu{" "U_NAMESPACE_END=}" U_HAVE_STD_STRING=1 U_SHOW_CPLUSPLUS_API=1 U_DEFINE_LOCAL_OPEN_POINTER()= U_IN_DOXYGEN=1 U_OVERRIDE= U_FINAL= UCONFIG_ENABLE_PLUGINS=1
+PREDEFINED             = U_EXPORT2= U_STABLE= U_DRAFT= U_INTERNAL= U_SYSTEM= U_DEPRECATED= U_OBSOLETE= U_CALLCONV= U_CDECL_BEGIN= U_CDECL_END=  U_NO_THROW=\ "U_NAMESPACE_BEGIN=namespace icu{" "U_NAMESPACE_END=}" U_SHOW_CPLUSPLUS_API=1 U_DEFINE_LOCAL_OPEN_POINTER()= U_IN_DOXYGEN=1 U_OVERRIDE= U_FINAL= UCONFIG_ENABLE_PLUGINS=1
 EXPAND_AS_DEFINED      = 
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
index f45cb0c8dfbb18d74c6d6a341394f005095d6ca9..a31992e99e8d938e569fa64359875ba8b27756a0 100644 (file)
@@ -222,8 +222,6 @@ private:
   CheckedArrayByteSink &operator=(const CheckedArrayByteSink &); ///< assignment operator not implemented
 };
 
-#if U_HAVE_STD_STRING
-
 /** 
  * Implementation of ByteSink that writes to a "string".
  * The StringClass is usually instantiated with a std::string.
@@ -252,8 +250,6 @@ class StringByteSink : public ByteSink {
   StringByteSink &operator=(const StringByteSink &); ///< assignment operator not implemented
 };
 
-#endif
-
 U_NAMESPACE_END
 
 #endif  // __BYTESTREAM_H__
index d29ab677e568e6913d2380136cedaf1138074311..b553b6878da06c1921745517473537b20f00253c 100644 (file)
 #define U_IOSTREAM_SOURCE 199711
 #endif
 
-/**
- * \def U_HAVE_STD_STRING
- * Defines whether the standard C++ (STL) &lt;string&gt; header is available.
- * @internal
- */
-#ifdef U_HAVE_STD_STRING
-    /* Use the predefined value. */
-#else
-#   define U_HAVE_STD_STRING 1
-#endif
-
 /*===========================================================================*/
 /** @{ Compiler and environment features                                     */
 /*===========================================================================*/
index b6ee427891ad5224f13836085289d2dff17e2e98..5750e6522197bd28051d6a6544218cedf676e1ee 100644 (file)
 #   define _XOPEN_SOURCE_EXTENDED 1
 #endif
 
-/*
- * There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms.
- * A compatibility issue exists between turning on _XOPEN_SOURCE_EXTENDED and using
- * standard C++ string class. As a result, standard C++ string class needs to be
- * turned off for the follwing platforms:
- *  -AIX/VACPP
- *  -Solaris/GCC
- */
-#if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__))
-#   if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING)
-// TODO: conflicts with unconditional use of std::string #   define U_HAVE_STD_STRING 0
-#   endif
-#endif
-
 #endif  /* __UPOSIXDEFS_H__ */
index f1494d572f6ecf060bc2d5262620aa13045846ea..b6065af79975340af1aaaf1697ad45bb896ab804 100644 (file)
@@ -514,19 +514,6 @@ if [[ "$GXX" = yes ]]; then
     fi
 fi
 
-AC_MSG_CHECKING([[if #include <string> works]])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]], [[]])], [ac_cv_header_stdstring=yes], [ac_cv_header_stdstring=no])
-AC_MSG_RESULT($ac_cv_header_stdstring)
-if test $ac_cv_header_stdstring = yes
-then
-       U_HAVE_STD_STRING=1
-else
-        U_HAVE_STD_STRING=0
-        CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
-fi
-AC_SUBST(U_HAVE_STD_STRING)
-
-
 AC_MSG_CHECKING([[if #include <atomic> works]])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
 AC_MSG_RESULT($ac_cv_header_atomic)
index 36f3d8b374f63f6f6c1d2b923fa41eb53c6015ed..94d5055f3d9249accda59749433a2533f8cba89a 100644 (file)
@@ -481,7 +481,6 @@ void CollationTest::TestFCD() {
     CodePointIterator cpi(cp, UPRV_LENGTHOF(cp));
     checkFCD("FCDUTF16CollationIterator", u16ci, cpi);
 
-#if U_HAVE_STD_STRING
     cpi.resetToStart();
     std::string utf8;
     UnicodeString(s).toUTF8String(utf8);
@@ -491,7 +490,6 @@ void CollationTest::TestFCD() {
         return;
     }
     checkFCD("FCDUTF8CollationIterator", u8ci, cpi);
-#endif
 
     cpi.resetToStart();
     UCharIterator iter;
@@ -1607,7 +1605,6 @@ UBool CollationTest::checkCompareTwo(const char *norm, const UnicodeString &prev
         }
     }
 
-#if U_HAVE_STD_STRING
     // compare(UTF-16) treats unpaired surrogates like unassigned code points.
     // Unpaired surrogates cannot be converted to UTF-8.
     // Create valid UTF-16 strings if necessary, and use those for
@@ -1672,7 +1669,6 @@ UBool CollationTest::checkCompareTwo(const char *norm, const UnicodeString &prev
             return FALSE;
         }
     }
-#endif
 
     UCharIterator leftIter;
     UCharIterator rightIter;
index 90a4e902de01a7bf9d72ffca7dcb6fe141570b73..8ed7c072310c89469058333300bad2f301bcb260 100644 (file)
@@ -25,7 +25,7 @@
 #include "unicode/ustring.h"
 #include "unicode/utext.h"
 #include "cmemory.h"
-#if !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING
+#if !UCONFIG_NO_BREAK_ITERATION
 #include "unicode/filteredbrk.h"
 #include <stdio.h> // for sprintf
 #endif
@@ -1154,7 +1154,7 @@ void RBBIAPITest::TestRefreshInputText() {
 
 }
 
-#if !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING && !UCONFIG_NO_FILTERED_BREAK_ITERATION
+#if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
 static void prtbrks(BreakIterator* brk, const UnicodeString &ustr, IntlTest &it) {
   static const UChar PILCROW=0x00B6, CHSTR=0x3010, CHEND=0x3011; // lenticular brackets
   it.logln(UnicodeString("String:'")+ustr+UnicodeString("'"));
@@ -1196,7 +1196,7 @@ static void prtbrks(BreakIterator* brk, const UnicodeString &ustr, IntlTest &it)
 #endif
 
 void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
-#if !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING && !UCONFIG_NO_FILTERED_BREAK_ITERATION
+#if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
   UErrorCode status = U_ZERO_ERROR;
   LocalPointer<FilteredBreakIteratorBuilder> builder;
   LocalPointer<BreakIterator> baseBI;
@@ -1392,7 +1392,7 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
   }
 
 #else
-  logln("Skipped- not: !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING && !UCONFIG_NO_FILTERED_BREAK_ITERATION");
+  logln("Skipped- not: !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION");
 #endif
 }
 
@@ -1423,7 +1423,7 @@ void RBBIAPITest::runIndexedTest( int32_t index, UBool exec, const char* &name,
     TESTCASE_AUTO(TestGetBinaryRules);
 #endif
     TESTCASE_AUTO(TestRefreshInputText);
-#if !UCONFIG_NO_BREAK_ITERATION && U_HAVE_STD_STRING
+#if !UCONFIG_NO_BREAK_ITERATION
     TESTCASE_AUTO(TestFilteredBreakIteratorBuilder);
 #endif
     TESTCASE_AUTO_END;
index eb06ca1b0df7574c8a5f11ba37183d2bb4e25d33..99a11af5ac1aee3fb2a034bc5dc0d67e8e308e74 100644 (file)
@@ -666,7 +666,6 @@ StringCaseTest::assertGreekUpper(const char *s, const char *expected) {
         }
     }
 
-#if U_HAVE_STD_STRING
     UErrorCode errorCode = U_ZERO_ERROR;
     LocalUCaseMapPointer csm(ucasemap_open("el", 0, &errorCode));
     assertSuccess("ucasemap_open", errorCode);
@@ -710,7 +709,6 @@ StringCaseTest::assertGreekUpper(const char *s, const char *expected) {
             assertEquals(msg + cap + " (memcmp)", 0, memcmp(dest8, dest8b, expected8Length));
         }
     }
-#endif
 }
 
 void
@@ -884,7 +882,6 @@ void StringCaseTest::TestBufferOverflow() {
     }
     errorCode.reset();
 
-#if U_HAVE_STD_STRING
     std::string data_utf8;
     data.toUTF8String(data_utf8);
     result = ucasemap_utf8ToTitle(csm.getAlias(), NULL, 0, data_utf8.c_str(), data_utf8.length(), errorCode);
@@ -894,7 +891,6 @@ void StringCaseTest::TestBufferOverflow() {
               __FILE__, __LINE__, data_utf8.length(), errorCode.errorName(), result);
     }
     errorCode.reset();
-#endif  // U_HAVE_STD_STRING
 }
 
 void StringCaseTest::checkEditsIter(
index 6566e1041d8b770cf21cb523b3dcbf64a574ce10..077dadf0ec60becc8c3bfea387cb4887658aecba 100644 (file)
@@ -830,8 +830,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
         }
-        // UTF-8 if we have std::string
-#if U_HAVE_STD_STRING
+        // UTF-8
         std::string input8, aT8, uT8, aN8, uN8;
         StringByteSink<std::string> aT8Sink(&aT8), uT8Sink(&uT8), aN8Sink(&aN8), uN8Sink(&uN8);
         IDNAInfo aT8Info, uT8Info, aN8Info, uN8Info;
@@ -879,7 +878,6 @@ void UTS46Test::TestSomeCases() {
                   testCase.o, (int)i, testCase.s);
             continue;
         }
-#endif
     }
 }
 
index 940db3b13c4fd4ec869d0def958e15f211400468..17aecffd56781fa38e0053a61e6b1ca2073fdb68 100644 (file)
@@ -25,9 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if U_HAVE_STD_STRING
 #include <vector>
-#endif
 #include "unicode/errorcode.h"
 #include "unicode/localpointer.h"
 #include "unicode/putil.h"
index fbb30ce32993a6312a7ab32804874cce4d4ea050..192d38d8a55e30110d723fed1c4d6245dfee8a9a 100644 (file)
@@ -613,40 +613,6 @@ U_CAPI char *udbg_knownIssueURLFrom(const char *ticket, char *buf) {
 }
 
 
-#if !U_HAVE_STD_STRING
-const char *warning = "WARNING: Don't have std::string (STL) - known issue logs will be deficient.";
-
-U_CAPI void *udbg_knownIssue_openU(void *ptr, const char *ticket, char *where, const UChar *msg, UBool *firstForTicket,
-                                   UBool *firstForWhere) {
-  if(ptr==NULL) {
-    puts(warning);
-  }
-  printf("%s\tKnown Issue #%s\n", where, ticket);
-
-  return (void*)warning;
-}
-
-U_CAPI void *udbg_knownIssue_open(void *ptr, const char *ticket, char *where, const char *msg, UBool *firstForTicket,
-                                   UBool *firstForWhere) {
-  if(ptr==NULL) {
-    puts(warning);
-  }
-  if(msg==NULL) msg = "";
-  printf("%s\tKnown Issue #%s  \"%s\n", where, ticket, msg);
-
-  return (void*)warning;
-}
-
-U_CAPI UBool udbg_knownIssue_print(void *ptr) {
-  puts(warning);
-  return FALSE;
-}
-
-U_CAPI void udbg_knownIssue_close(void *ptr) {
-  // nothing to do
-}
-#else
-
 #include <set>
 #include <map>
 #include <string>
@@ -785,5 +751,3 @@ U_CAPI void udbg_knownIssue_close(void *ptr) {
   KnownIssues *t = static_cast<KnownIssues*>(ptr);
   delete t;
 }
-
-#endif