Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Unified Diff: source/common/unicode/platform.h

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/unicode/parsepos.h ('k') | source/common/unicode/ptypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/unicode/platform.h
diff --git a/source/common/unicode/platform.h b/source/common/unicode/platform.h
index 8eed735ac8f92db71dfb45f285463186014e853e..b42bef8323415607d7c71dc144d500c7521a5739 100644
--- a/source/common/unicode/platform.h
+++ b/source/common/unicode/platform.h
@@ -1,7 +1,9 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
*
-* Copyright (C) 1997-2015, International Business Machines
+* Copyright (C) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -428,10 +430,13 @@
# define U_HAVE_DEBUG_LOCATION_NEW 0
#endif
-/* Compatibility with non clang compilers */
+/* Compatibility with non clang compilers: http://clang.llvm.org/docs/LanguageExtensions.html */
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
+#ifndef __has_cpp_attribute
+# define __has_cpp_attribute(x) 0
+#endif
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
@@ -441,6 +446,9 @@
#ifndef __has_extension
# define __has_extension(x) 0
#endif
+#ifndef __has_warning
+# define __has_warning(x) 0
+#endif
/**
* \def U_MALLOC_ATTR
@@ -514,6 +522,8 @@
*/
#ifdef U_NOEXCEPT
/* Use the predefined value. */
+#elif defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS /* Visual Studio */
+# define U_NOEXCEPT
#elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_noexcept) || __has_extension(cxx_noexcept) \
|| (defined(_MSC_VER) && _MSC_VER >= 1900) /* Visual Studio 2015 */
# define U_NOEXCEPT noexcept
@@ -521,6 +531,24 @@
# define U_NOEXCEPT
#endif
+/**
+ * \def U_FALLTHROUGH
+ * Annotate intentional fall-through between switch labels.
+ * http://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough
+ * @internal
+ */
+#ifdef __cplusplus
+# if __has_cpp_attribute(clang::fallthrough) || \
+ (__has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough"))
+# define U_FALLTHROUGH [[clang::fallthrough]]
+# else
+# define U_FALLTHROUGH
+# endif
+#else
+# define U_FALLTHROUGH
+#endif
+
+
/** @} */
/*===========================================================================*/
@@ -815,6 +843,12 @@
* This is only used for non-ICU-API functions.
* When a function is a public ICU API,
* you must use the U_CAPI and U_EXPORT2 qualifiers.
+ *
+ * Please note, you need to use U_CALLCONV after the *.
+ *
+ * NO : "static const char U_CALLCONV *func( . . . )"
+ * YES: "static const char* U_CALLCONV func( . . . )"
+ *
* @stable ICU 2.0
*/
#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
« no previous file with comments | « source/common/unicode/parsepos.h ('k') | source/common/unicode/ptypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698