ICU 64.2
64.2
|
Basic types for the platform. More...
Go to the source code of this file.
Macros | |
#define | U_PF_UNKNOWN 0 |
Unknown platform. More... | |
#define | U_PF_WINDOWS 1000 |
Windows. More... | |
#define | U_PF_MINGW 1800 |
MinGW. More... | |
#define | U_PF_CYGWIN 1900 |
Cygwin. More... | |
#define | U_PF_HPUX 2100 |
HP-UX is based on UNIX System V. More... | |
#define | U_PF_SOLARIS 2600 |
Solaris is a Unix operating system based on SVR4. More... | |
#define | U_PF_BSD 3000 |
BSD is a UNIX operating system derivative. More... | |
#define | U_PF_AIX 3100 |
AIX is based on UNIX System V Releases and 4.3 BSD. More... | |
#define | U_PF_IRIX 3200 |
IRIX is based on UNIX System V with BSD extensions. More... | |
#define | U_PF_DARWIN 3500 |
Darwin is a POSIX-compliant operating system, composed of code developed by Apple, as well as code derived from NeXTSTEP, BSD, and other projects, built around the Mach kernel. More... | |
#define | U_PF_IPHONE 3550 |
iPhone OS (iOS) is a derivative of Mac OS X. More... | |
#define | U_PF_QNX 3700 |
QNX is a commercial Unix-like real-time operating system related to BSD. More... | |
#define | U_PF_LINUX 4000 |
Linux is a Unix-like operating system. More... | |
#define | U_PF_BROWSER_NATIVE_CLIENT 4020 |
Native Client is pretty close to Linux. More... | |
#define | U_PF_ANDROID 4050 |
Android is based on Linux. More... | |
#define | U_PF_FUCHSIA 4100 |
Fuchsia is a POSIX-ish platform. More... | |
#define | U_PF_OS390 9000 |
z/OS is the successor to OS/390 which was the successor to MVS. More... | |
#define | U_PF_OS400 9400 |
"IBM i" is the current name of what used to be i5/OS and earlier OS/400. More... | |
#define | U_PLATFORM U_PF_UNKNOWN |
Define some things so that they can be documented. More... | |
#define | CYGWINMSVC |
Defined if this is Windows with Cygwin, but using MSVC rather than gcc. More... | |
#define | U_PLATFORM_USES_ONLY_WIN32_API 1 |
Defines whether the platform uses only the Win32 API. More... | |
#define | U_PLATFORM_HAS_WIN32_API 0 |
Defines whether the Win32 API is available on the platform. More... | |
#define | U_PLATFORM_HAS_WINUWP_API 0 |
Defines whether target is intended for Universal Windows Platform API Set to 1 for Windows10 Release Solution Configuration. More... | |
#define | U_PLATFORM_IMPLEMENTS_POSIX 0 |
Defines whether the platform implements (most of) the POSIX API. More... | |
#define | U_PLATFORM_IS_LINUX_BASED 0 |
Defines whether the platform is Linux or one of its derivatives. More... | |
#define | U_PLATFORM_IS_DARWIN_BASED 0 |
Defines whether the platform is Darwin or one of its derivatives. More... | |
#define | U_HAVE_STDINT_H 0 |
Defines whether stdint.h is available. More... | |
#define | U_HAVE_INTTYPES_H U_HAVE_STDINT_H |
Defines whether inttypes.h is available. More... | |
#define | U_HAVE_CHAR16_T 0 |
Defines whether the char16_t type is available for UTF-16 and u"abc" UTF-16 string literals are supported. More... | |
#define | U_GCC_MAJOR_MINOR 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | U_IS_BIG_ENDIAN 0 |
Determines the endianness of the platform. More... | |
#define | U_HAVE_PLACEMENT_NEW 1 |
Determines whether to override placement new and delete for STL. More... | |
#define | U_HAVE_DEBUG_LOCATION_NEW 0 |
Define this to define the MFC debug version of the operator new. More... | |
#define | __has_attribute(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_cpp_attribute(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_declspec_attribute(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_builtin(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_feature(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_extension(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | __has_warning(x) 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | U_MALLOC_ATTR |
Attribute to mark functions as malloc-like. More... | |
#define | U_ALLOC_SIZE_ATTR(X) |
Attribute to specify the size of the allocated buffer for malloc-like functions. More... | |
#define | U_ALLOC_SIZE_ATTR2(X, Y) |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers. More... | |
#define | U_CPLUSPLUS_VERSION 0 |
0 if no C++; 1, 11, 14, ... More... | |
#define | U_NOEXCEPT noexcept |
"noexcept" if supported, otherwise empty. More... | |
#define | U_FALLTHROUGH |
Annotate intentional fall-through between switch labels. More... | |
#define | U_ASCII_FAMILY 0 |
U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform. More... | |
#define | U_EBCDIC_FAMILY 1 |
U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform. More... | |
#define | U_CHARSET_FAMILY U_ASCII_FAMILY |
#define | U_CHARSET_IS_UTF8 0 |
Hardcode the default charset to UTF-8. More... | |
#define | U_HAVE_WCHAR_H 1 |
Indicates whether <wchar.h> is available (1) or not (0). More... | |
#define | U_SIZEOF_WCHAR_T 4 |
U_SIZEOF_WCHAR_T==sizeof(wchar_t) More... | |
#define | U_HAVE_WCSCPY U_HAVE_WCHAR_H |
Indicates whether <wchar.h> is available (1) or not (0). More... | |
#define | U_DECLARE_UTF16(string) u ## string |
Do not use this macro because it is not defined on all platforms. More... | |
#define | U_EXPORT |
#define | U_IMPORT |
#define | U_CALLCONV U_EXPORT2 |
Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary in callback function typedefs to make sure that the calling convention is compatible. More... | |
#define | U_CALLCONV_FPTR |
Similar to U_CALLCONV, but only used on function pointers. More... | |
Basic types for the platform.
This file used to be generated by autoconf/configure. Starting with ICU 49, platform.h is a normal source file, to simplify cross-compiling and working with non-autoconf/make build systems.
When a value in this file does not work on a platform, then please try to derive it from the U_PLATFORM value (for which we might need a new value constant in rare cases) and/or from other macros that are predefined by the compiler or defined in standard (POSIX or platform or compiler) headers.
As a temporary workaround, you can add an explicit #define for some macros before it is first tested, or add an equivalent -D macro definition to the compiler's command line.
Note: Some compilers provide ways to show the predefined macros. For example, with gcc you can compile an empty .c file and have the compiler print the predefined macros with
(You can provide an actual empty .c file rather than /dev/null. -x c++
is for C++.)
Definition in file platform.h.
#define __has_attribute | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 418 of file platform.h.
#define __has_builtin | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 427 of file platform.h.
#define __has_cpp_attribute | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 421 of file platform.h.
#define __has_declspec_attribute | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 424 of file platform.h.
#define __has_extension | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 433 of file platform.h.
#define __has_feature | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 430 of file platform.h.
#define __has_warning | ( | x | ) | 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 436 of file platform.h.
#define CYGWINMSVC |
Defined if this is Windows with Cygwin, but using MSVC rather than gcc.
Otherwise undefined.
Definition at line 211 of file platform.h.
#define U_ALLOC_SIZE_ATTR | ( | X | ) |
Attribute to specify the size of the allocated buffer for malloc-like functions.
This API is for internal use only.
Definition at line 459 of file platform.h.
#define U_ALLOC_SIZE_ATTR2 | ( | X, | |
Y | |||
) |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 460 of file platform.h.
#define U_ASCII_FAMILY 0 |
U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform.
Character data types
Definition at line 541 of file platform.h.
#define U_CALLCONV U_EXPORT2 |
Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary in callback function typedefs to make sure that the calling convention is compatible.
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( . . . )"
Definition at line 840 of file platform.h.
Referenced by icu::RuleBasedCollator::rbcFromUCollator().
#define U_CALLCONV_FPTR |
Similar to U_CALLCONV, but only used on function pointers.
Definition at line 851 of file platform.h.
#define U_CHARSET_FAMILY U_ASCII_FAMILY |
These definitions allow to specify the encoding of text in the char data type as defined by the platform and the compiler. It is enough to determine the code point values of "invariant characters", which are the ones shared by all encodings that are in use on a given platform.
Those "invariant characters" should be all the uppercase and lowercase latin letters, the digits, the space, and "basic punctuation". Also, '\n', '\r', '\t' should be available.
The list of "invariant characters" is:
(52 letters + 10 numbers + 20 punc/sym/space = 82 total)
This matches the IBM Syntactic Character Set (CS 640).
In other words, all the graphic characters in 7-bit ASCII should be safely accessible except the following:
Definition at line 598 of file platform.h.
#define U_CHARSET_IS_UTF8 0 |
Hardcode the default charset to UTF-8.
If this is set to 1, then
Definition at line 626 of file platform.h.
#define U_CPLUSPLUS_VERSION 0 |
0 if no C++; 1, 11, 14, ...
if C++. Support for specific features cannot always be determined by the C++ version alone.
Definition at line 472 of file platform.h.
#define U_DECLARE_UTF16 | ( | string | ) | u ## string |
Do not use this macro because it is not defined on all platforms.
Use the UNICODE_STRING or U_STRING_DECL macros instead.
Definition at line 771 of file platform.h.
#define U_EBCDIC_FAMILY 1 |
U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform.
Definition at line 547 of file platform.h.
#define U_EXPORT |
Symbol import-export control
Definition at line 799 of file platform.h.
Referenced by icu::StringPiece::substr().
#define U_FALLTHROUGH |
Annotate intentional fall-through between switch labels.
http://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough
Definition at line 528 of file platform.h.
#define U_GCC_MAJOR_MINOR 0 |
Indicates whether the compiler is gcc (test for != 0), and if so, contains its major (times 100) and minor version numbers.
Compiler and environment features If the compiler is not gcc, then U_GCC_MAJOR_MINOR == 0.
For example, for testing for whether we have gcc, and whether it's 4.6 or higher, use "#if U_GCC_MAJOR_MINOR >= 406".
Definition at line 357 of file platform.h.
#define U_HAVE_CHAR16_T 0 |
Defines whether the char16_t type is available for UTF-16 and u"abc" UTF-16 string literals are supported.
This is a new standard type and standard string literal syntax in C++0x but has been available in some compilers before.
Definition at line 753 of file platform.h.
#define U_HAVE_DEBUG_LOCATION_NEW 0 |
Define this to define the MFC debug version of the operator new.
Definition at line 413 of file platform.h.
#define U_HAVE_INTTYPES_H U_HAVE_STDINT_H |
Defines whether inttypes.h is available.
It is a C99 standard header. We include inttypes.h where it is available but stdint.h is not.
Definition at line 337 of file platform.h.
#define U_HAVE_PLACEMENT_NEW 1 |
Determines whether to override placement new and delete for STL.
Definition at line 399 of file platform.h.
#define U_HAVE_STDINT_H 0 |
Defines whether stdint.h is available.
It is a C99 standard header. We used to include inttypes.h which includes stdint.h but we usually do not need the additional definitions from inttypes.h.
Definition at line 309 of file platform.h.
#define U_HAVE_WCHAR_H 1 |
Indicates whether <wchar.h> is available (1) or not (0).
Information about wchar support Set to 1 by default.
Definition at line 651 of file platform.h.
#define U_HAVE_WCSCPY U_HAVE_WCHAR_H |
Indicates whether <wchar.h> is available (1) or not (0).
Information about wchar support Set to 1 by default.
Definition at line 723 of file platform.h.
#define U_IMPORT |
Symbol import-export control
Definition at line 817 of file platform.h.
#define U_IS_BIG_ENDIAN 0 |
Determines the endianness of the platform.
Definition at line 386 of file platform.h.
#define U_MALLOC_ATTR |
Attribute to mark functions as malloc-like.
This API is for internal use only.
Definition at line 447 of file platform.h.
#define U_NOEXCEPT noexcept |
"noexcept" if supported, otherwise empty.
Some code, especially STL containers, uses move semantics of objects only if the move constructor and the move operator are declared as not throwing exceptions.
Definition at line 503 of file platform.h.
Referenced by icu::Edits::Edits(), icu::FormattedDateInterval::FormattedDateInterval(), icu::FormattedList::FormattedList(), icu::number::FormattedNumber::FormattedNumber(), icu::FormattedRelativeDateTime::FormattedRelativeDateTime(), icu::Edits::getFineIterator(), icu::number::impl::SymbolsWrapper::SymbolsWrapper(), icu::UnicodeString::toUTF8String(), and icu::UnicodeString::UnicodeString().
#define U_PF_AIX 3100 |
AIX is based on UNIX System V Releases and 4.3 BSD.
Definition at line 108 of file platform.h.
#define U_PF_ANDROID 4050 |
Android is based on Linux.
Definition at line 134 of file platform.h.
#define U_PF_BROWSER_NATIVE_CLIENT 4020 |
Native Client is pretty close to Linux.
See https://developer.chrome.com/native-client and http://www.chromium.org/nativeclient
Definition at line 132 of file platform.h.
#define U_PF_BSD 3000 |
BSD is a UNIX operating system derivative.
Definition at line 106 of file platform.h.
#define U_PF_CYGWIN 1900 |
Cygwin.
Windows, calls to cygwin1.dll for Posix functions, using MSVC or GNU gcc and binutils.
Definition at line 99 of file platform.h.
#define U_PF_DARWIN 3500 |
Darwin is a POSIX-compliant operating system, composed of code developed by Apple, as well as code derived from NeXTSTEP, BSD, and other projects, built around the Mach kernel.
Darwin forms the core set of components upon which Mac OS X, Apple TV, and iOS are based. (Original description modified from WikiPedia.)
Definition at line 119 of file platform.h.
#define U_PF_FUCHSIA 4100 |
Fuchsia is a POSIX-ish platform.
Definition at line 136 of file platform.h.
#define U_PF_HPUX 2100 |
HP-UX is based on UNIX System V.
Definition at line 102 of file platform.h.
#define U_PF_IPHONE 3550 |
iPhone OS (iOS) is a derivative of Mac OS X.
Definition at line 121 of file platform.h.
#define U_PF_IRIX 3200 |
IRIX is based on UNIX System V with BSD extensions.
Definition at line 110 of file platform.h.
#define U_PF_LINUX 4000 |
Linux is a Unix-like operating system.
Definition at line 125 of file platform.h.
#define U_PF_MINGW 1800 |
MinGW.
Windows, calls to Win32 API, but using GNU gcc and binutils.
Definition at line 93 of file platform.h.
#define U_PF_OS390 9000 |
z/OS is the successor to OS/390 which was the successor to MVS.
Definition at line 139 of file platform.h.
#define U_PF_OS400 9400 |
"IBM i" is the current name of what used to be i5/OS and earlier OS/400.
Definition at line 141 of file platform.h.
#define U_PF_QNX 3700 |
QNX is a commercial Unix-like real-time operating system related to BSD.
Definition at line 123 of file platform.h.
#define U_PF_SOLARIS 2600 |
Solaris is a Unix operating system based on SVR4.
Definition at line 104 of file platform.h.
#define U_PF_UNKNOWN 0 |
Unknown platform.
Definition at line 89 of file platform.h.
#define U_PF_WINDOWS 1000 |
Windows.
This API is for internal use only.
Definition at line 91 of file platform.h.
#define U_PLATFORM U_PF_UNKNOWN |
Define some things so that they can be documented.
The U_PLATFORM macro defines the platform we're on.
We used to define one different, value-less macro per platform. That made it hard to know the set of relevant platforms and macros, and hard to deal with variants of platforms.
Starting with ICU 49, we define platforms as numeric macros, with ranges of values for related platforms and their variants. The U_PLATFORM macro is set to one of these values.
Historical note from the Solaris Wikipedia article: AT&T and Sun collaborated on a project to merge the most popular Unix variants on the market at that time: BSD, System V, and Xenix. This became Unix System V Release 4 (SVR4).
Definition at line 196 of file platform.h.
#define U_PLATFORM_HAS_WIN32_API 0 |
Defines whether the Win32 API is available on the platform.
Set to 1 for Windows/MSVC, MinGW and Cygwin.
Definition at line 240 of file platform.h.
#define U_PLATFORM_HAS_WINUWP_API 0 |
Defines whether target is intended for Universal Windows Platform API Set to 1 for Windows10 Release Solution Configuration.
This API is for internal use only.
Definition at line 252 of file platform.h.
#define U_PLATFORM_IMPLEMENTS_POSIX 0 |
Defines whether the platform implements (most of) the POSIX API.
Set to 1 for Cygwin and most other platforms.
Definition at line 264 of file platform.h.
#define U_PLATFORM_IS_DARWIN_BASED 0 |
Defines whether the platform is Darwin or one of its derivatives.
Definition at line 292 of file platform.h.
#define U_PLATFORM_IS_LINUX_BASED 0 |
Defines whether the platform is Linux or one of its derivatives.
Definition at line 279 of file platform.h.
#define U_PLATFORM_USES_ONLY_WIN32_API 1 |
Defines whether the platform uses only the Win32 API.
Set to 1 for Windows/MSVC and MinGW but not Cygwin.
Definition at line 223 of file platform.h.
#define U_SIZEOF_WCHAR_T 4 |