]> granicus.if.org Git - icu/commitdiff
ICU-9469 Improve support for C++11
authorGeorge Rhoten <grhoten@users.noreply.github.com>
Wed, 15 Aug 2012 17:46:17 +0000 (17:46 +0000)
committerGeorge Rhoten <grhoten@users.noreply.github.com>
Wed, 15 Aug 2012 17:46:17 +0000 (17:46 +0000)
X-SVN-Rev: 32179

17 files changed:
icu4c/source/aclocal.m4
icu4c/source/common/unicode/platform.h
icu4c/source/configure
icu4c/source/configure.in
icu4c/source/i18n/unicode/uspoof.h
icu4c/source/i18n/uspoof.cpp
icu4c/source/io/ufile.c
icu4c/source/runConfigureICU
icu4c/source/test/cintltst/cmsccoll.c
icu4c/source/test/intltest/bytestrietest.cpp
icu4c/source/test/intltest/intltest.cpp
icu4c/source/test/intltest/numrgts.cpp
icu4c/source/test/intltest/ucharstrietest.cpp
icu4c/source/tools/ctestfw/uperf.cpp
icu4c/source/tools/genrb/derb.c
icu4c/source/tools/toolutil/dbgutil.cpp
icu4c/source/tools/toolutil/dbgutil.h

index e19cff824fe671bd2b3583e6aaaf720c99e07c75..a67979c50fce502ef0b367a98922453244502ebf 100644 (file)
@@ -452,15 +452,9 @@ AC_DEFUN(AC_CHECK_STRICT_COMPILE,
     then
         if test "$GCC" = yes
         then
-            case "${host}" in
-            *-*-solaris*)
-                CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            *-*-hpux*)
-                echo "# Note: We are not using '-ansi' with HP/UX GCC because int64_t broke, see <http://bugs.icu-project.org/trac/ticket/8493>"
-                CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            *)
-                CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            esac
+            # Do not use -ansi. It limits us to C90, and it breaks some platforms.
+            # We use -std=c99 to disable the gnu99 defaults and its associated warnings
+            CFLAGS="$CFLAGS -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
         else
             case "${host}" in
             *-*-cygwin)
@@ -472,7 +466,7 @@ AC_DEFUN(AC_CHECK_STRICT_COMPILE,
         fi
         if test "$GXX" = yes
         then
-            CXXFLAGS="$CXXFLAGS -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
+            CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
         else
             case "${host}" in
             *-*-cygwin)
index 50c121b9b027d75f9d99d1c5b19bf037fd069bd4..e16717376a3da121712047ba342443f9ee9e42c6 100644 (file)
      * does not support u"abc" string literals.
      * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but
      * does not support u"abc" string literals.
+     * C++11 requires support for UTF-16 literals
      */
-#   define U_HAVE_CHAR16_T 0
+#   if (defined(__cplusplus) && __cplusplus >= 201103L)
+#       define U_HAVE_CHAR16_T 1
+#   else
+#       define U_HAVE_CHAR16_T 0
+#   endif
 #endif
 
 /**
  */
 #ifdef U_DECLARE_UTF16
     /* Use the predefined value. */
-#elif (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+#elif U_HAVE_CHAR16_T \
+    || (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
     || (defined(__HP_aCC) && __HP_aCC >= 035000) \
-    || (defined(__HP_cc) && __HP_cc >= 111106) \
-    || U_HAVE_CHAR16_T
+    || (defined(__HP_cc) && __HP_cc >= 111106)
 #   define U_DECLARE_UTF16(string) u ## string
-#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
-/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
-/* Sun's C compiler has issues with this notation, and it's unreliable. */
-#   define U_DECLARE_UTF16(string) U ## string
 #elif U_SIZEOF_WCHAR_T == 2 \
     && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
 #   define U_DECLARE_UTF16(string) L ## string
index cf4ddb75e1a057b82fa1ddd75b48c007c31e5eef..337dd70c65c820bad123afc0df835a8673ed22e5 100755 (executable)
@@ -621,8 +621,6 @@ pkgicudatadir
 LAYOUT_TRUE
 ICUIO_TRUE
 EXTRAS_TRUE
-U_CHECK_UTF16_STRING
-U_CHECK_GNUC_UTF16_STRING
 U_HAVE_WCSCPY
 U_HAVE_WCHAR_H
 U_TIMEZONE
@@ -634,7 +632,6 @@ U_HAVE_TZSET
 U_HAVE_POPEN
 U_HAVE_PLACEMENT_NEW
 U_OVERRIDE_CXX_ALLOCATION
-U_HAVE_NAMESPACE
 U_NL_LANGINFO_CODESET
 U_HAVE_NL_LANGINFO_CODESET
 U_IS_BIG_ENDIAN
@@ -2742,7 +2739,7 @@ $as_echo "$enabled" >&6; }
 : ${CFLAGS=""}
 : ${CXXFLAGS=""}
 
-# Checks for programs
+# Checks for compilers
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3533,6 +3530,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+# Make sure that we try clang++ first, which provides C++11 support.
+# The g++ compiler is less likely to support C++11.
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3543,7 +3542,7 @@ if test -z "$CXX"; then
     CXX=$CCC
   else
     if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  for ac_prog in clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe FCC KCC RCC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@@ -3587,7 +3586,7 @@ fi
 fi
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  for ac_prog in clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe FCC KCC RCC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -4257,15 +4256,9 @@ $as_echo "$ac_use_strict_options" >&6; }
     then
         if test "$GCC" = yes
         then
-            case "${host}" in
-            *-*-solaris*)
-                CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            *-*-hpux*)
-                echo "# Note: We are not using '-ansi' with HP/UX GCC because int64_t broke, see <http://bugs.icu-project.org/trac/ticket/8493>"
-                CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            *)
-                CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
-            esac
+            # Do not use -ansi. It limits us to C90, and it breaks some platforms.
+            # We use -std=c99 to disable the gnu99 defaults and its associated warnings
+            CFLAGS="$CFLAGS -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
         else
             case "${host}" in
             *-*-cygwin)
@@ -4277,7 +4270,7 @@ $as_echo "$ac_use_strict_options" >&6; }
         fi
         if test "$GXX" = yes
         then
-            CXXFLAGS="$CXXFLAGS -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
+            CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
         else
             case "${host}" in
             *-*-cygwin)
@@ -5248,7 +5241,7 @@ $as_echo_n "checking whether we can use static library optimization option... "
 
             case "${host}" in
             *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
-                if test "$ac_cv_c_compiler_gnu" = yes; then
+                if test "$GCC" = yes; then
                     CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
                     LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
                 fi
@@ -6503,14 +6496,11 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_namespace_ok" >&5
 $as_echo "$ac_cv_namespace_ok" >&6; }
-U_HAVE_NAMESPACE=1
 if test $ac_cv_namespace_ok = no
 then
     as_fn_error $? "Namespace support is required to build ICU." "$LINENO" 5
-    U_HAVE_NAMESPACE=0
 fi
 
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for properly overriding new and delete" >&5
 $as_echo_n "checking for properly overriding new and delete... " >&6; }
 U_OVERRIDE_CXX_ALLOCATION=0
@@ -7091,7 +7081,7 @@ CHECK_UTF16_STRING_RESULT="unknown"
 
 case "${host}" in
 *-*-aix*|powerpc64-*-linux*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         OLD_CFLAGS="${CFLAGS}"
         OLD_CXXFLAGS="${CXXFLAGS}"
         CFLAGS="${CFLAGS} -qutf"
@@ -7122,7 +7112,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     ;;
 *-*-solaris*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         OLD_CFLAGS="${CFLAGS}"
         OLD_CXXFLAGS="${CXXFLAGS}"
         CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
@@ -7161,7 +7151,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     ;;
 *-*-hpux*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         # The option will be detected at compile time without additional compiler options.
         CHECK_UTF16_STRING_RESULT="available"
     fi
@@ -7175,25 +7165,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 esac
 
 # GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
-# Since we have to use a different standard, if strict is enable, don't enable UTF16 string literals.
-U_CHECK_GNUC_UTF16_STRING=0
-if test "$ac_use_strict_options" = no && test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
-    if test "$ac_cv_c_compiler_gnu" = yes; then
+if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
+    if test "$GCC" = yes; then
         OLD_CFLAGS="${CFLAGS}"
-        OLD_CXXFLAGS="${CXXFLAGS}"
-        CFLAGS="${CFLAGS} -std=gnu99 -D_GCC_"
-        CXXFLAGS="${CXXFLAGS} -std=c++0x"
+        CFLAGS="${CFLAGS} -std=gnu99"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-#ifdef _GCC_
-typedef __CHAR16_TYPE__ char16_t;
-#endif
-char16_t test[] = u"This is a UTF16 literal string.";
-#else
-GCC IS TOO OLD!
-#endif
+static const char16_t test[] = u"This is a UTF16 literal string.";
 
 int
 main ()
@@ -7204,26 +7183,66 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  U_CHECK_UTF16_STRING=1
+  CC_UTF16_STRING=1
 else
-  U_CHECK_UTF16_STRING=0
+  CC_UTF16_STRING=0
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        if test "$U_CHECK_UTF16_STRING" = 1; then
-            CHECK_UTF16_STRING_RESULT="available";
-            U_CHECK_GNUC_UTF16_STRING=1
+        if test "$CC_UTF16_STRING" = 1; then
+            CHECK_UTF16_STRING_RESULT="C only";
         else
             CFLAGS="${OLD_CFLAGS}"
-            CXXFLAGS="${OLD_CXXFLAGS}"
         fi
     fi
-fi
+    if test "$GXX" = yes; then
+        OLD_CXXFLAGS="${CXXFLAGS}"
+        # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
+        CXXFLAGS="${CXXFLAGS} -std=c++11"
+        ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+static const char16_t test[] = u"This is a UTF16 literal string.";
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  CXX_UTF16_STRING=1
+else
+  CXX_UTF16_STRING=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+        if test "$CXX_UTF16_STRING" = 1; then
+            if test "$CC_UTF16_STRING" = 1; then
+                CHECK_UTF16_STRING_RESULT="available";
+            else
+                CHECK_UTF16_STRING_RESULT="C++ only";
+            fi
+        else
+            CXXFLAGS="${OLD_CXXFLAGS}"
+        fi
+    fi
+fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_UTF16_STRING_RESULT" >&5
 $as_echo "$CHECK_UTF16_STRING_RESULT" >&6; }
 
-
 # Enable/disable extras
 # Check whether --enable-extras was given.
 if test "${enable_extras+set}" = set; then :
index 897d1c2c0b3e465b82535ec47a8bfaf62b6ace86..09ff425a6b0d6e85f735d6dd36f2d3fb3966be51 100644 (file)
@@ -120,9 +120,11 @@ AC_SUBST(ENABLE_RELEASE)
 : ${CFLAGS=""}
 : ${CXXFLAGS=""}
 
-# Checks for programs
+# Checks for compilers
 AC_PROG_CC
-AC_PROG_CXX
+# Make sure that we try clang++ first, which provides C++11 support.
+# The g++ compiler is less likely to support C++11.
+AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe FCC KCC RCC])
 
 # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
 # The release mode use is the default one for autoconf
@@ -276,7 +278,7 @@ if test "$ENABLE_STATIC" = "YES"; then
             
             case "${host}" in
             *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
-                if test "$ac_cv_c_compiler_gnu" = yes; then
+                if test "$GCC" = yes; then
                     CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
                     LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
                 fi
@@ -676,13 +678,10 @@ AC_CACHE_VAL(ac_cv_namespace_ok,
     using namespace x_version;
     ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
 AC_MSG_RESULT($ac_cv_namespace_ok)
-U_HAVE_NAMESPACE=1
 if test $ac_cv_namespace_ok = no
 then
     AC_MSG_ERROR(Namespace support is required to build ICU.)
-    U_HAVE_NAMESPACE=0
 fi
-AC_SUBST(U_HAVE_NAMESPACE)
 
 AC_MSG_CHECKING([for properly overriding new and delete])
 U_OVERRIDE_CXX_ALLOCATION=0
@@ -905,7 +904,7 @@ CHECK_UTF16_STRING_RESULT="unknown"
 
 case "${host}" in
 *-*-aix*|powerpc64-*-linux*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         OLD_CFLAGS="${CFLAGS}"
         OLD_CXXFLAGS="${CXXFLAGS}"
         CFLAGS="${CFLAGS} -qutf"
@@ -920,7 +919,7 @@ case "${host}" in
     fi
     ;;
 *-*-solaris*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         OLD_CFLAGS="${CFLAGS}"
         OLD_CXXFLAGS="${CXXFLAGS}"
         CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
@@ -943,7 +942,7 @@ case "${host}" in
     fi
     ;;
 *-*-hpux*)
-    if test "$ac_cv_c_compiler_gnu" = no; then
+    if test "$GCC" = no; then
         # The option will be detected at compile time without additional compiler options.
         CHECK_UTF16_STRING_RESULT="available"
     fi
@@ -957,37 +956,40 @@ case "${host}" in
 esac
 
 # GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
-# Since we have to use a different standard, if strict is enable, don't enable UTF16 string literals.
-U_CHECK_GNUC_UTF16_STRING=0
-if test "$ac_use_strict_options" = no && test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
-    if test "$ac_cv_c_compiler_gnu" = yes; then
+if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
+    if test "$GCC" = yes; then
         OLD_CFLAGS="${CFLAGS}"
-        OLD_CXXFLAGS="${CXXFLAGS}"
-        CFLAGS="${CFLAGS} -std=gnu99 -D_GCC_"
-        CXXFLAGS="${CXXFLAGS} -std=c++0x"
+        CFLAGS="${CFLAGS} -std=gnu99"
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-#ifdef _GCC_
-typedef __CHAR16_TYPE__ char16_t;
-#endif
-char16_t test[] = u"This is a UTF16 literal string.";
-#else
-GCC IS TOO OLD!
-#endif
-        ]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
-        if test "$U_CHECK_UTF16_STRING" = 1; then
-            CHECK_UTF16_STRING_RESULT="available";
-            U_CHECK_GNUC_UTF16_STRING=1
+static const char16_t test[] = u"This is a UTF16 literal string.";
+        ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
+        if test "$CC_UTF16_STRING" = 1; then
+            CHECK_UTF16_STRING_RESULT="C only";
         else
             CFLAGS="${OLD_CFLAGS}"
+        fi
+    fi
+    if test "$GXX" = yes; then
+        OLD_CXXFLAGS="${CXXFLAGS}"
+        # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
+        CXXFLAGS="${CXXFLAGS} -std=c++11"
+        AC_LANG_PUSH([C++])
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+static const char16_t test[] = u"This is a UTF16 literal string.";
+        ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
+        AC_LANG_POP([C++])
+        if test "$CXX_UTF16_STRING" = 1; then
+            if test "$CC_UTF16_STRING" = 1; then
+                CHECK_UTF16_STRING_RESULT="available";
+            else
+                CHECK_UTF16_STRING_RESULT="C++ only";
+            fi
+        else
             CXXFLAGS="${OLD_CXXFLAGS}"
         fi
     fi
 fi
-AC_SUBST(U_CHECK_GNUC_UTF16_STRING)
-
 AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
-AC_SUBST(U_CHECK_UTF16_STRING)
 
 # Enable/disable extras
 AC_ARG_ENABLE(extras,
index 478b7b645461220d6f9bfcd73e0c57eebd55175c..e59d314c266d38c74e3d8aa8b907d5c2de0e638e 100644 (file)
@@ -847,7 +847,7 @@ uspoof_getSkeletonUTF8(const USpoofChecker *sc,
   *                
   * @stable ICU 4.2
   */   
-U_STABLE icu::UnicodeString & U_EXPORT2
+U_I18N_API icu::UnicodeString & U_EXPORT2
 uspoof_getSkeletonUnicodeString(const USpoofChecker *sc,
                                 uint32_t type,
                                 const icu::UnicodeString &s,
index 72bb7edae4139009381d8d5b18fb3f81226beb9f..a8984329e6b9164f749e8305e11205184dbefdfe 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ***************************************************************************
-* Copyright (C) 2008-2011, International Business Machines Corporation
+* Copyright (C) 2008-2012, International Business Machines Corporation
 * and others. All Rights Reserved.
 ***************************************************************************
 *   file name:  uspoof.cpp
@@ -713,7 +713,7 @@ uspoof_getSkeleton(const USpoofChecker *sc,
 
 
 
-U_CAPI UnicodeString &  U_EXPORT2
+U_I18N_API UnicodeString &  U_EXPORT2
 uspoof_getSkeletonUnicodeString(const USpoofChecker *sc,
                                 uint32_t type,
                                 const UnicodeString &s,
index e49d5b95dc504bbac3d99b0bc13b8691e18da2af..2aca838fff43e1dbca9b1c23084e822627f07d2e 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2011, International Business Machines
+*   Copyright (C) 1998-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 ******************************************************************************
 */
 
-/*
- * Defines _XOPEN_SOURCE for access to POSIX functions.
- * Must be before any other #includes.
- */
-#include "uposixdefs.h"
-
 #include "locmap.h"
 #include "unicode/ustdio.h"
 #include "ufile.h"
index dbedb7814e26f8cf001a2238d0619071e662e5af..432f9fb3677ee18363b06fb2b3b2168245c4a05d 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 1999-2011, International Business Machines Corporation and
+# Copyright (c) 1999-2012, International Business Machines Corporation and
 # others. All Rights Reserved.
 
 # runConfigureICU: This script will run the "configure" script for the appropriate platform
@@ -227,8 +227,6 @@ case $platform in
     Linux*)
         THE_OS="Linux"
         THE_COMP="the GNU C++"
-        CC=gcc; export CC
-        CXX=g++; export CXX
         DEBUG_CFLAGS='-g -O0'
         DEBUG_CXFLAGS='-g -O0'
         ;;
index 3ec30d377f36c0bdea5c0a61de941cff2eb2c31a..243da6e55554914e112b1606143e89d83e586266 100644 (file)
@@ -4674,7 +4674,7 @@ static void TestBeforeTightening(void) {
 
 }
 
-#if 0
+/*
 &m < a
 &[before 1] a < x <<< X << q <<< Q < z
 assert: m <<< M < x <<< X << q <<< Q < z < a < n
@@ -4732,7 +4732,7 @@ assert:  x <<< X << q <<< Q << m <<< \u24DC <<< M < z < n
 
 &[before 3] \u24DC <<< x <<< X << q <<< Q < z
 assert: m <<< x <<< X <<< \u24DC <<< M  << q <<< Q < z < n
-#endif
+*/
 
 
 #if 0
index 12101d2f0c8b39cfbb32d312d914184f1de7e641..2d7fa6ed0826b8af2e3961260d30c31c14f2ddcf 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-*   Copyright (C) 2010-2011, International Business Machines
+*   Copyright (C) 2010-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  bytetrietest.cpp
@@ -170,7 +170,7 @@ void BytesTrieTest::TestBranches() {
         { "t", 0x400000 },
         { "uu", 0x800000 },
         { "vv", 0x7fffffff },
-        { "zz", 0x80000000 }
+        { "zz", (int32_t)0x80000000 }
     };
     for(int32_t length=2; length<=LENGTHOF(data); ++length) {
         infoln("TestBranches length=%d", (int)length);
@@ -217,7 +217,7 @@ void BytesTrieTest::TestLongBranch() {
         { "r", 0x333333 },
         { "s2345", 0x4444444 },
         { "t234567890", 0x77777777 },
-        { "z", 0x80000001 }
+        { "z", (int32_t)0x80000001 }
     };
     checkData(data, LENGTHOF(data));
 }
index ff26c64de3ecd7ec60849020eed3f2a43eb1c662..de4bf25621d00c05df13e80401357926d950818f 100644 (file)
@@ -653,7 +653,7 @@ UBool IntlTest::runTest( char* name, char* par, char *baseName )
 }
 
 // call individual tests, to be overriden to call implementations
-void IntlTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
+void IntlTest::runIndexedTest( int32_t /*index*/, UBool /*exec*/, const char* & /*name*/, char* /*par*/ )
 {
     // to be overriden by a method like:
     /*
@@ -664,7 +664,6 @@ void IntlTest::runIndexedTest( int32_t index, UBool exec, const char* &name, cha
     }
     */
     this->errln("*** runIndexedTest needs to be overriden! ***");
-    name = ""; exec = exec; index = index; par = par;
 }
 
 
index 8617bfc099d4acba9c9a22725ead7693ea87de6c..3f725291fcb2e7775918936552e2d9cdc268256a 100644 (file)
@@ -29,10 +29,10 @@ public:
   
     virtual UnicodeString& format(    double            number, 
                     UnicodeString&        toAppendTo, 
-                    FieldPosition&        pos,
+                    FieldPositionIterator* posIter,
                     UErrorCode& status) const
     {
-        return NumberFormat::format(number, toAppendTo, pos, status);
+        return NumberFormat::format(number, toAppendTo, posIter, status);
     }
 
     /* Just keep this here to make some of the compilers happy */
index b44789f1de6a33e4207597792a0d793877fbbed6..26c5d720cffeacdd8273ee4e47d4d6e79a4f73c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
-*   Copyright (C) 2010-2011, International Business Machines
+*   Copyright (C) 2010-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  ucharstrietest.cpp
@@ -179,7 +179,7 @@ void UCharsTrieTest::TestBranches() {
         { "t", 0x400000 },
         { "uu", 0x800000 },
         { "vv", 0x7fffffff },
-        { "zz", 0x80000000 }
+        { "zz", (int32_t)0x80000000 }
     };
     for(int32_t length=2; length<=LENGTHOF(data); ++length) {
         infoln("TestBranches length=%d", (int)length);
@@ -226,7 +226,7 @@ void UCharsTrieTest::TestLongBranch() {
         { "r", 0x333333 },
         { "s2345", 0x4444444 },
         { "t234567890", 0x77777777 },
-        { "z", 0x80000001 }
+        { "z", (int32_t)0x80000001 }
     };
     checkData(data, LENGTHOF(data));
 }
index e8c34391127af782b62c999f8b17c4ad397594b7..9ff20edccaae01838a7ee8e14aee26e61ed2e33d 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 2002-2011, International Business Machines Corporation and
+ * Copyright (c) 2002-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 
@@ -322,7 +322,7 @@ void UPerfTest::setPath( char* pathVal )
 }
 
 // call individual tests, to be overriden to call implementations
-UPerfFunction* UPerfTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
+UPerfFunction* UPerfTest::runIndexedTest( int32_t /*index*/, UBool /*exec*/, const char* & /*name*/, char* /*par*/ )
 {
     // to be overriden by a method like:
     /*
@@ -333,7 +333,6 @@ UPerfFunction* UPerfTest::runIndexedTest( int32_t index, UBool exec, const char*
     }
     */
     fprintf(stderr,"*** runIndexedTest needs to be overriden! ***");
-    name = ""; exec = exec; index = index; par = par;
     return NULL;
 }
 
index 65db73eba5051983051ef3cfd40fda00eea1737d..2a48d98f542980eb75072682c59524556845ed4d 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2011, International Business Machines
+*   Copyright (C) 1999-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -54,7 +54,7 @@ static UConverter *defaultConverter = 0;
 
 static const int32_t indentsize = 4;
 static int32_t truncsize = DERB_DEFAULT_TRUNC;
-static UBool trunc = FALSE;
+static UBool truncate = FALSE;
 
 static const char *getEncodingName(const char *encoding);
 static void reportError(const char *pname, UErrorCode *status, const char *when);
@@ -152,14 +152,14 @@ main(int argc, char* argv[]) {
     }
 
     if(options[4].doesOccur) {
-        trunc = TRUE;
+        truncate = TRUE;
         if(options[4].value != NULL) {
             truncsize = atoi(options[4].value); /* user defined printable size */
         } else {
             truncsize = DERB_DEFAULT_TRUNC; /* we'll use default omitting size */
         }
     } else {
-        trunc = FALSE;
+        truncate = FALSE;
     }
 
     if(options[5].doesOccur) {
@@ -473,7 +473,7 @@ static void printOutAlias(FILE *out,  UConverter *converter, UResourceBundle *pa
     int32_t len = 0;
     const UChar* thestr = res_getAlias(&(parent->fResData), r, &len);
     UChar *string = quotedString(thestr);
-    if(trunc && len > truncsize) {
+    if(truncate && len > truncsize) {
         char msg[128];
         printIndent(out, converter, indent);
         sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n",
@@ -517,7 +517,7 @@ static void printOutBundle(FILE *out, UConverter *converter, UResourceBundle *re
             UChar *string = quotedString(thestr);
 
             /* TODO: String truncation */
-            if(trunc && len > truncsize) {
+            if(truncate && len > truncsize) {
                 char msg[128];
                 printIndent(out, converter, indent);
                 sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n",
@@ -576,7 +576,7 @@ static void printOutBundle(FILE *out, UConverter *converter, UResourceBundle *re
         {
             int32_t len = 0;
             const int8_t *data = (const int8_t *)ures_getBinary(resource, &len, status);
-            if(trunc && len > truncsize) {
+            if(truncate && len > truncsize) {
                 char msg[128];
                 printIndent(out, converter, indent);
                 sprintf(msg, "// WARNING: this resource, size %li is truncated to %li\n",
index c0254554ae1580696eaffaa5f0de2805c6a77640..d4c87735689961e9fd35104b9452d80193c91de9 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT:
- * Copyright (c) 2007-2010, International Business Machines Corporation and
+ * Copyright (c) 2007-2012, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 
@@ -74,7 +74,7 @@ static void udbg_setup(void) {
 
 
 
-U_CAPI const UnicodeString& U_EXPORT2 udbg_enumString(UDebugEnumType type, int32_t field) {
+U_TOOLUTIL_API const UnicodeString& U_EXPORT2 udbg_enumString(UDebugEnumType type, int32_t field) {
     if(strs == NULL ) {
         udbg_setup();
     }
index 9e5b6c88af868971146e34f1b1a9d9cce859911a..d76b72baa2f2d049411aee02088d41cf1832e595 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
 ************************************************************************
-* Copyright (c) 2007-2011, International Business Machines
+* Copyright (c) 2007-2012, International Business Machines
 * Corporation and others.  All Rights Reserved.
 ************************************************************************
 */
@@ -17,7 +17,7 @@
 
 #if !UCONFIG_NO_FORMATTING
 
-U_CAPI const icu::UnicodeString& U_EXPORT2
+U_TOOLUTIL_API const icu::UnicodeString& U_EXPORT2
 udbg_enumString(UDebugEnumType type, int32_t field);
 
 /**