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

Side by Side Diff: source/common/unicode/platform.h

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « source/common/unicode/normlzr.h ('k') | source/common/unicode/ubrk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ****************************************************************************** 2 ******************************************************************************
3 * 3 *
4 * Copyright (C) 1997-2014, International Business Machines 4 * Copyright (C) 1997-2015, International Business Machines
5 * Corporation and others. All Rights Reserved. 5 * Corporation and others. All Rights Reserved.
6 * 6 *
7 ****************************************************************************** 7 ******************************************************************************
8 * 8 *
9 * FILE NAME : platform.h 9 * FILE NAME : platform.h
10 * 10 *
11 * Date Name Description 11 * Date Name Description
12 * 05/13/98 nos Creation (content moved here from ptypes.h). 12 * 05/13/98 nos Creation (content moved here from ptypes.h).
13 * 03/02/99 stephen Added AS400 support. 13 * 03/02/99 stephen Added AS400 support.
14 * 03/30/99 stephen Added Linux support. 14 * 03/30/99 stephen Added Linux support.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 * (Original description modified from WikiPedia.) 114 * (Original description modified from WikiPedia.)
115 * @internal 115 * @internal
116 */ 116 */
117 #define U_PF_DARWIN 3500 117 #define U_PF_DARWIN 3500
118 /** iPhone OS (iOS) is a derivative of Mac OS X. @internal */ 118 /** iPhone OS (iOS) is a derivative of Mac OS X. @internal */
119 #define U_PF_IPHONE 3550 119 #define U_PF_IPHONE 3550
120 /** QNX is a commercial Unix-like real-time operating system related to BSD. @in ternal */ 120 /** QNX is a commercial Unix-like real-time operating system related to BSD. @in ternal */
121 #define U_PF_QNX 3700 121 #define U_PF_QNX 3700
122 /** Linux is a Unix-like operating system. @internal */ 122 /** Linux is a Unix-like operating system. @internal */
123 #define U_PF_LINUX 4000 123 #define U_PF_LINUX 4000
124 /** Native Client is pretty close to Linux. @internal */ 124 /**
125 #define U_PF_NATIVE_CLIENT 4050 125 * Native Client is pretty close to Linux.
126 * See https://developer.chrome.com/native-client and
127 * http://www.chromium.org/nativeclient
128 * @internal
129 */
130 #define U_PF_BROWSER_NATIVE_CLIENT 4020
126 /** Android is based on Linux. @internal */ 131 /** Android is based on Linux. @internal */
127 #define U_PF_ANDROID 4100 132 #define U_PF_ANDROID 4050
133 /* Maximum value for Linux-based platform is 4499 */
128 /** z/OS is the successor to OS/390 which was the successor to MVS. @internal */ 134 /** z/OS is the successor to OS/390 which was the successor to MVS. @internal */
129 #define U_PF_OS390 9000 135 #define U_PF_OS390 9000
130 /** "IBM i" is the current name of what used to be i5/OS and earlier OS/400. @in ternal */ 136 /** "IBM i" is the current name of what used to be i5/OS and earlier OS/400. @in ternal */
131 #define U_PF_OS400 9400 137 #define U_PF_OS400 9400
132 138
133 #ifdef U_PLATFORM 139 #ifdef U_PLATFORM
134 /* Use the predefined value. */ 140 /* Use the predefined value. */
135 #elif defined(__MINGW32__) 141 #elif defined(__MINGW32__)
136 # define U_PLATFORM U_PF_MINGW 142 # define U_PLATFORM U_PF_MINGW
137 #elif defined(__CYGWIN__) 143 #elif defined(__CYGWIN__)
138 # define U_PLATFORM U_PF_CYGWIN 144 # define U_PLATFORM U_PF_CYGWIN
139 #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 145 #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
140 # define U_PLATFORM U_PF_WINDOWS 146 # define U_PLATFORM U_PF_WINDOWS
141 #elif defined(__ANDROID__) 147 #elif defined(__ANDROID__)
142 # define U_PLATFORM U_PF_ANDROID 148 # define U_PLATFORM U_PF_ANDROID
143 /* Android wchar_t support depends on the API level. */ 149 /* Android wchar_t support depends on the API level. */
144 # include <android/api-level.h> 150 # include <android/api-level.h>
145 #elif defined(__native_client__) 151 #elif defined(__native_client__)
146 # define U_PLATFORM U_PF_NATIVE_CLIENT 152 # define U_PLATFORM U_PF_BROWSER_NATIVE_CLIENT
147 #elif defined(linux) || defined(__linux__) || defined(__linux) 153 #elif defined(linux) || defined(__linux__) || defined(__linux)
148 # define U_PLATFORM U_PF_LINUX 154 # define U_PLATFORM U_PF_LINUX
149 #elif defined(__APPLE__) && defined(__MACH__) 155 #elif defined(__APPLE__) && defined(__MACH__)
150 # include <TargetConditionals.h> 156 # include <TargetConditionals.h>
151 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* variant of TARGET_OS_MA C */ 157 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* variant of TARGET_OS_MA C */
152 # define U_PLATFORM U_PF_IPHONE 158 # define U_PLATFORM U_PF_IPHONE
153 # else 159 # else
154 # define U_PLATFORM U_PF_DARWIN 160 # define U_PLATFORM U_PF_DARWIN
155 # endif 161 # endif
156 #elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || def ined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__) 162 #elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || def ined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__)
163 # if defined(__FreeBSD__)
164 # include <sys/endian.h>
165 # endif
157 # define U_PLATFORM U_PF_BSD 166 # define U_PLATFORM U_PF_BSD
158 #elif defined(sun) || defined(__sun) 167 #elif defined(sun) || defined(__sun)
159 /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from Su nOS? */ 168 /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from Su nOS? */
160 # define U_PLATFORM U_PF_SOLARIS 169 # define U_PLATFORM U_PF_SOLARIS
161 # if defined(__GNUC__) 170 # if defined(__GNUC__)
162 /* Solaris/GCC needs this header file to get the proper endianness. Norm ally, this 171 /* Solaris/GCC needs this header file to get the proper endianness. Norm ally, this
163 * header file is included with stddef.h but on Solairs/GCC, the GCC ver sion of stddef.h 172 * header file is included with stddef.h but on Solairs/GCC, the GCC ver sion of stddef.h
164 * is included which does not include this header file. 173 * is included which does not include this header file.
165 */ 174 */
166 # include <sys/isa_defs.h> 175 # include <sys/isa_defs.h>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 # define U_PLATFORM_IMPLEMENTS_POSIX 1 245 # define U_PLATFORM_IMPLEMENTS_POSIX 1
237 #endif 246 #endif
238 247
239 /** 248 /**
240 * \def U_PLATFORM_IS_LINUX_BASED 249 * \def U_PLATFORM_IS_LINUX_BASED
241 * Defines whether the platform is Linux or one of its derivatives. 250 * Defines whether the platform is Linux or one of its derivatives.
242 * @internal 251 * @internal
243 */ 252 */
244 #ifdef U_PLATFORM_IS_LINUX_BASED 253 #ifdef U_PLATFORM_IS_LINUX_BASED
245 /* Use the predefined value. */ 254 /* Use the predefined value. */
246 #elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= U_PF_ANDROID 255 #elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= 4499
247 # define U_PLATFORM_IS_LINUX_BASED 1 256 # define U_PLATFORM_IS_LINUX_BASED 1
248 #else 257 #else
249 # define U_PLATFORM_IS_LINUX_BASED 0 258 # define U_PLATFORM_IS_LINUX_BASED 0
250 #endif 259 #endif
251 260
252 /** 261 /**
253 * \def U_PLATFORM_IS_DARWIN_BASED 262 * \def U_PLATFORM_IS_DARWIN_BASED
254 * Defines whether the platform is Darwin or one of its derivatives. 263 * Defines whether the platform is Darwin or one of its derivatives.
255 * @internal 264 * @internal
256 */ 265 */
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 #elif defined(_MSC_VER) 425 #elif defined(_MSC_VER)
417 # define U_HAVE_DEBUG_LOCATION_NEW 1 426 # define U_HAVE_DEBUG_LOCATION_NEW 1
418 #else 427 #else
419 # define U_HAVE_DEBUG_LOCATION_NEW 0 428 # define U_HAVE_DEBUG_LOCATION_NEW 0
420 #endif 429 #endif
421 430
422 /* Compatibility with non clang compilers */ 431 /* Compatibility with non clang compilers */
423 #ifndef __has_attribute 432 #ifndef __has_attribute
424 # define __has_attribute(x) 0 433 # define __has_attribute(x) 0
425 #endif 434 #endif
435 #ifndef __has_builtin
436 # define __has_builtin(x) 0
437 #endif
438 #ifndef __has_feature
439 # define __has_feature(x) 0
440 #endif
441 #ifndef __has_extension
442 # define __has_extension(x) 0
443 #endif
426 444
427 /** 445 /**
428 * \def U_MALLOC_ATTR 446 * \def U_MALLOC_ATTR
429 * Attribute to mark functions as malloc-like 447 * Attribute to mark functions as malloc-like
430 * @internal 448 * @internal
431 */ 449 */
432 #if defined(__GNUC__) && __GNUC__>=3 450 #if defined(__GNUC__) && __GNUC__>=3
433 # define U_MALLOC_ATTR __attribute__ ((__malloc__)) 451 # define U_MALLOC_ATTR __attribute__ ((__malloc__))
434 #else 452 #else
435 # define U_MALLOC_ATTR 453 # define U_MALLOC_ATTR
436 #endif 454 #endif
437 455
438 /** 456 /**
439 * \def U_ALLOC_SIZE_ATTR 457 * \def U_ALLOC_SIZE_ATTR
440 * Attribute to specify the size of the allocated buffer for malloc-like functio ns 458 * Attribute to specify the size of the allocated buffer for malloc-like functio ns
441 * @internal 459 * @internal
442 */ 460 */
443 #if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 ))) || __has_attribute(alloc_size) 461 #if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 ))) || __has_attribute(alloc_size)
444 # define U_ALLOC_SIZE_ATTR(X) __attribute__ ((alloc_size(X))) 462 # define U_ALLOC_SIZE_ATTR(X) __attribute__ ((alloc_size(X)))
445 # define U_ALLOC_SIZE_ATTR2(X,Y) __attribute__ ((alloc_size(X,Y))) 463 # define U_ALLOC_SIZE_ATTR2(X,Y) __attribute__ ((alloc_size(X,Y)))
446 #else 464 #else
447 # define U_ALLOC_SIZE_ATTR(X) 465 # define U_ALLOC_SIZE_ATTR(X)
448 # define U_ALLOC_SIZE_ATTR2(X,Y) 466 # define U_ALLOC_SIZE_ATTR2(X,Y)
449 #endif 467 #endif
450 468
469 /**
470 * \def U_CPLUSPLUS_VERSION
471 * 0 if no C++; 1, 11, 14, ... if C++.
472 * Support for specific features cannot always be determined by the C++ version alone.
473 * @internal
474 */
475 #ifdef U_CPLUSPLUS_VERSION
476 # if U_CPLUSPLUS_VERSION != 0 && !defined(__cplusplus)
477 # undef U_CPLUSPLUS_VERSION
478 # define U_CPLUSPLUS_VERSION 0
479 # endif
480 /* Otherwise use the predefined value. */
481 #elif !defined(__cplusplus)
482 # define U_CPLUSPLUS_VERSION 0
483 #elif __cplusplus >= 201402L
484 # define U_CPLUSPLUS_VERSION 14
485 #elif __cplusplus >= 201103L
486 # define U_CPLUSPLUS_VERSION 11
487 #else
488 // C++98 or C++03
489 # define U_CPLUSPLUS_VERSION 1
490 #endif
491
492 /**
493 * \def U_HAVE_RVALUE_REFERENCES
494 * Set to 1 if the compiler supports rvalue references.
495 * C++11 feature, necessary for move constructor & move assignment.
496 * @internal
497 */
498 #ifdef U_HAVE_RVALUE_REFERENCES
499 /* Use the predefined value. */
500 #elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_rvalue_references) \
501 || defined(__GXX_EXPERIMENTAL_CXX0X__) \
502 || (defined(_MSC_VER) && _MSC_VER >= 1600) /* Visual Studio 2010 */
503 # define U_HAVE_RVALUE_REFERENCES 1
504 #else
505 # define U_HAVE_RVALUE_REFERENCES 0
506 #endif
507
508 /**
509 * \def U_NOEXCEPT
510 * "noexcept" if supported, otherwise empty.
511 * Some code, especially STL containers, uses move semantics of objects only
512 * if the move constructor and the move operator are declared as not throwing ex ceptions.
513 * @internal
514 */
515 #ifdef U_NOEXCEPT
516 /* Use the predefined value. */
517 #elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_noexcept) || __has_extensio n(cxx_noexcept) \
518 || (defined(_MSC_VER) && _MSC_VER >= 1900) /* Visual Studio 2015 */
519 # define U_NOEXCEPT noexcept
520 #else
521 # define U_NOEXCEPT
522 #endif
523
451 /** @} */ 524 /** @} */
452 525
453 /*===========================================================================*/ 526 /*===========================================================================*/
454 /** @{ Character data types */ 527 /** @{ Character data types */
455 /*===========================================================================*/ 528 /*===========================================================================*/
456 529
457 /** 530 /**
458 * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based p latform. 531 * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based p latform.
459 * @stable ICU 2.0 532 * @stable ICU 2.0
460 */ 533 */
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 /* Use the predefined value. */ 730 /* Use the predefined value. */
658 #else 731 #else
659 /* 732 /*
660 * Notes: 733 * Notes:
661 * Visual Studio 10 (_MSC_VER>=1600) defines char16_t but 734 * Visual Studio 10 (_MSC_VER>=1600) defines char16_t but
662 * does not support u"abc" string literals. 735 * does not support u"abc" string literals.
663 * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but 736 * gcc 4.4 defines the __CHAR16_TYPE__ macro to a usable type but
664 * does not support u"abc" string literals. 737 * does not support u"abc" string literals.
665 * C++11 and C11 require support for UTF-16 literals 738 * C++11 and C11 require support for UTF-16 literals
666 */ 739 */
667 # if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSI ON__) && __STDC_VERSION__ >= 201112L) 740 # if U_CPLUSPLUS_VERSION >= 11 || (defined(__STDC_VERSION__) && __STDC_VERSION __ >= 201112L)
668 # define U_HAVE_CHAR16_T 1 741 # define U_HAVE_CHAR16_T 1
669 # else 742 # else
670 # define U_HAVE_CHAR16_T 0 743 # define U_HAVE_CHAR16_T 0
671 # endif 744 # endif
672 #endif 745 #endif
673 746
674 /** 747 /**
675 * @{ 748 * @{
676 * \def U_DECLARE_UTF16 749 * \def U_DECLARE_UTF16
677 * Do not use this macro because it is not defined on all platforms. 750 * Do not use this macro because it is not defined on all platforms.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 */ 819 */
747 #if U_PLATFORM == U_PF_OS390 && defined(__cplusplus) 820 #if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
748 # define U_CALLCONV __cdecl 821 # define U_CALLCONV __cdecl
749 #else 822 #else
750 # define U_CALLCONV U_EXPORT2 823 # define U_CALLCONV U_EXPORT2
751 #endif 824 #endif
752 825
753 /* @} */ 826 /* @} */
754 827
755 #endif 828 #endif
OLDNEW
« no previous file with comments | « source/common/unicode/normlzr.h ('k') | source/common/unicode/ubrk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698