ICU 73.2  73.2
platform.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /*
00004 ******************************************************************************
00005 *
00006 *   Copyright (C) 1997-2016, International Business Machines
00007 *   Corporation and others.  All Rights Reserved.
00008 *
00009 ******************************************************************************
00010 *
00011 *  FILE NAME : platform.h
00012 *
00013 *   Date        Name        Description
00014 *   05/13/98    nos         Creation (content moved here from ptypes.h).
00015 *   03/02/99    stephen     Added AS400 support.
00016 *   03/30/99    stephen     Added Linux support.
00017 *   04/13/99    stephen     Reworked for autoconf.
00018 ******************************************************************************
00019 */
00020 
00021 #ifndef _PLATFORM_H
00022 #define _PLATFORM_H
00023 
00024 #include "unicode/uconfig.h"
00025 #include "unicode/uvernum.h"
00026 
00059 #ifdef U_IN_DOXYGEN
00060 /*
00061  * Problem: "platform.h:335: warning: documentation for unknown define U_HAVE_STD_STRING found." means that U_HAVE_STD_STRING is not documented.
00062  * Solution: #define any defines for non @internal API here, so that they are visible in the docs.  If you just set PREDEFINED in Doxyfile.in,  they won't be documented.
00063  */
00064 
00065 /* None for now. */
00066 #endif
00067 
00089 #define U_PF_UNKNOWN 0
00090 
00091 #define U_PF_WINDOWS 1000
00092 
00093 #define U_PF_MINGW 1800
00094 
00099 #define U_PF_CYGWIN 1900
00100 /* Reserve 2000 for U_PF_UNIX? */
00102 #define U_PF_HPUX 2100
00103 
00104 #define U_PF_SOLARIS 2600
00105 
00106 #define U_PF_BSD 3000
00107 
00108 #define U_PF_AIX 3100
00109 
00110 #define U_PF_IRIX 3200
00111 
00119 #define U_PF_DARWIN 3500
00120 
00121 #define U_PF_IPHONE 3550
00122 
00123 #define U_PF_QNX 3700
00124 
00125 #define U_PF_LINUX 4000
00126 
00132 #define U_PF_BROWSER_NATIVE_CLIENT 4020
00133 
00134 #define U_PF_ANDROID 4050
00135 
00136 #define U_PF_FUCHSIA 4100
00137 /* Maximum value for Linux-based platform is 4499 */
00145 #define U_PF_EMSCRIPTEN 5010
00146 
00147 #define U_PF_OS390 9000
00148 
00149 #define U_PF_OS400 9400
00150 
00151 #ifdef U_PLATFORM
00152     /* Use the predefined value. */
00153 #elif defined(__MINGW32__)
00154 #   define U_PLATFORM U_PF_MINGW
00155 #elif defined(__CYGWIN__)
00156 #   define U_PLATFORM U_PF_CYGWIN
00157 #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
00158 #   define U_PLATFORM U_PF_WINDOWS
00159 #elif defined(__ANDROID__)
00160 #   define U_PLATFORM U_PF_ANDROID
00161     /* Android wchar_t support depends on the API level. */
00162 #   include <android/api-level.h>
00163 #elif defined(__pnacl__) || defined(__native_client__)
00164 #   define U_PLATFORM U_PF_BROWSER_NATIVE_CLIENT
00165 #elif defined(__Fuchsia__)
00166 #   define U_PLATFORM U_PF_FUCHSIA
00167 #elif defined(linux) || defined(__linux__) || defined(__linux)
00168 #   define U_PLATFORM U_PF_LINUX
00169 #elif defined(__APPLE__) && defined(__MACH__)
00170 #   include <TargetConditionals.h>
00171 #   if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && (defined(TARGET_OS_MACCATALYST) && !TARGET_OS_MACCATALYST)   /* variant of TARGET_OS_MAC */
00172 #       define U_PLATFORM U_PF_IPHONE
00173 #   else
00174 #       define U_PLATFORM U_PF_DARWIN
00175 #   endif
00176 #elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__)
00177 #   if defined(__FreeBSD__)
00178 #       include <sys/endian.h>
00179 #   endif
00180 #   define U_PLATFORM U_PF_BSD
00181 #elif defined(sun) || defined(__sun)
00182     /* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */
00183 #   define U_PLATFORM U_PF_SOLARIS
00184 #   if defined(__GNUC__)
00185         /* Solaris/GCC needs this header file to get the proper endianness. Normally, this
00186          * header file is included with stddef.h but on Solairs/GCC, the GCC version of stddef.h
00187          *  is included which does not include this header file.
00188          */
00189 #       include <sys/isa_defs.h>
00190 #   endif
00191 #elif defined(_AIX) || defined(__TOS_AIX__)
00192 #   define U_PLATFORM U_PF_AIX
00193 #elif defined(_hpux) || defined(hpux) || defined(__hpux)
00194 #   define U_PLATFORM U_PF_HPUX
00195 #elif defined(sgi) || defined(__sgi)
00196 #   define U_PLATFORM U_PF_IRIX
00197 #elif defined(__QNX__) || defined(__QNXNTO__)
00198 #   define U_PLATFORM U_PF_QNX
00199 #elif defined(__TOS_MVS__)
00200 #   define U_PLATFORM U_PF_OS390
00201 #elif defined(__OS400__) || defined(__TOS_OS400__)
00202 #   define U_PLATFORM U_PF_OS400
00203 #elif defined(__EMSCRIPTEN__)
00204 #   define U_PLATFORM U_PF_EMSCRIPTEN
00205 #else
00206 #   define U_PLATFORM U_PF_UNKNOWN
00207 #endif
00208 
00215 /* Commented out because this is already set in mh-cygwin-msvc
00216 #if U_PLATFORM == U_PF_CYGWIN && defined(_MSC_VER)
00217 #   define CYGWINMSVC
00218 #endif
00219 */
00220 #ifdef U_IN_DOXYGEN
00221 #   define CYGWINMSVC
00222 #endif
00223 
00230 #ifdef U_PLATFORM_USES_ONLY_WIN32_API
00231     /* Use the predefined value. */
00232 #elif (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_MINGW) || defined(CYGWINMSVC)
00233 #   define U_PLATFORM_USES_ONLY_WIN32_API 1
00234 #else
00235     /* Cygwin implements POSIX. */
00236 #   define U_PLATFORM_USES_ONLY_WIN32_API 0
00237 #endif
00238 
00245 #ifdef U_PLATFORM_HAS_WIN32_API
00246     /* Use the predefined value. */
00247 #elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
00248 #   define U_PLATFORM_HAS_WIN32_API 1
00249 #else
00250 #   define U_PLATFORM_HAS_WIN32_API 0
00251 #endif
00252 
00259 #ifdef U_PLATFORM_HAS_WINUWP_API
00260     /* Use the predefined value. */
00261 #else
00262 #   define U_PLATFORM_HAS_WINUWP_API 0
00263 #endif
00264 
00271 #ifdef U_PLATFORM_IMPLEMENTS_POSIX
00272     /* Use the predefined value. */
00273 #elif U_PLATFORM_USES_ONLY_WIN32_API
00274 #   define U_PLATFORM_IMPLEMENTS_POSIX 0
00275 #else
00276 #   define U_PLATFORM_IMPLEMENTS_POSIX 1
00277 #endif
00278 
00284 #ifdef U_PLATFORM_IS_LINUX_BASED
00285     /* Use the predefined value. */
00286 #elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= 4499
00287 #   define U_PLATFORM_IS_LINUX_BASED 1
00288 #else
00289 #   define U_PLATFORM_IS_LINUX_BASED 0
00290 #endif
00291 
00297 #ifdef U_PLATFORM_IS_DARWIN_BASED
00298     /* Use the predefined value. */
00299 #elif U_PF_DARWIN <= U_PLATFORM && U_PLATFORM <= U_PF_IPHONE
00300 #   define U_PLATFORM_IS_DARWIN_BASED 1
00301 #else
00302 #   define U_PLATFORM_IS_DARWIN_BASED 0
00303 #endif
00304 
00312 #ifdef U_HAVE_STDINT_H
00313     /* Use the predefined value. */
00314 #elif U_PLATFORM_USES_ONLY_WIN32_API
00315 #   if defined(__BORLANDC__) || U_PLATFORM == U_PF_MINGW || (defined(_MSC_VER) && _MSC_VER>=1600)
00316         /* Windows Visual Studio 9 and below do not have stdint.h & inttypes.h, but VS 2010 adds them. */
00317 #       define U_HAVE_STDINT_H 1
00318 #   else
00319 #       define U_HAVE_STDINT_H 0
00320 #   endif
00321 #elif U_PLATFORM == U_PF_SOLARIS
00322     /* Solaris has inttypes.h but not stdint.h. */
00323 #   define U_HAVE_STDINT_H 0
00324 #elif U_PLATFORM == U_PF_AIX && !defined(_AIX51) && defined(_POWER)
00325     /* PPC AIX <= 4.3 has inttypes.h but not stdint.h. */
00326 #   define U_HAVE_STDINT_H 0
00327 #else
00328 #   define U_HAVE_STDINT_H 1
00329 #endif
00330 
00337 #ifdef U_HAVE_INTTYPES_H
00338     /* Use the predefined value. */
00339 #elif U_PLATFORM == U_PF_SOLARIS
00340     /* Solaris has inttypes.h but not stdint.h. */
00341 #   define U_HAVE_INTTYPES_H 1
00342 #elif U_PLATFORM == U_PF_AIX && !defined(_AIX51) && defined(_POWER)
00343     /* PPC AIX <= 4.3 has inttypes.h but not stdint.h. */
00344 #   define U_HAVE_INTTYPES_H 1
00345 #else
00346     /* Most platforms have both inttypes.h and stdint.h, or neither. */
00347 #   define U_HAVE_INTTYPES_H U_HAVE_STDINT_H
00348 #endif
00349 
00350 /*===========================================================================*/
00352 /*===========================================================================*/
00353 
00364 #ifdef __GNUC__
00365 #   define U_GCC_MAJOR_MINOR (__GNUC__ * 100 + __GNUC_MINOR__)
00366 #else
00367 #   define U_GCC_MAJOR_MINOR 0
00368 #endif
00369 
00375 #ifdef U_IS_BIG_ENDIAN
00376     /* Use the predefined value. */
00377 #elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
00378 #   define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
00379 #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
00380     /* gcc */
00381 #   define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
00382 #elif defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
00383 #   define U_IS_BIG_ENDIAN 1
00384 #elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
00385 #   define U_IS_BIG_ENDIAN 0
00386 #elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400 || defined(__s390__) || defined(__s390x__)
00387     /* These platforms do not appear to predefine any endianness macros. */
00388 #   define U_IS_BIG_ENDIAN 1
00389 #elif defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0)
00390     /* HPPA do not appear to predefine any endianness macros. */
00391 #   define U_IS_BIG_ENDIAN 1
00392 #elif defined(sparc) || defined(__sparc) || defined(__sparc__)
00393     /* Some sparc based systems (e.g. Linux) do not predefine any endianness macros. */
00394 #   define U_IS_BIG_ENDIAN 1
00395 #else
00396 #   define U_IS_BIG_ENDIAN 0
00397 #endif
00398 
00404 #ifdef U_HAVE_PLACEMENT_NEW
00405     /* Use the predefined value. */
00406 #elif defined(__BORLANDC__)
00407 #   define U_HAVE_PLACEMENT_NEW 0
00408 #else
00409 #   define U_HAVE_PLACEMENT_NEW 1
00410 #endif
00411 
00418 #ifdef U_HAVE_DEBUG_LOCATION_NEW
00419     /* Use the predefined value. */
00420 #elif defined(_MSC_VER)
00421 #   define U_HAVE_DEBUG_LOCATION_NEW 1
00422 #else
00423 #   define U_HAVE_DEBUG_LOCATION_NEW 0
00424 #endif
00425 
00426 /* Compatibility with compilers other than clang: http://clang.llvm.org/docs/LanguageExtensions.html */
00427 #ifdef __has_attribute
00428 #   define UPRV_HAS_ATTRIBUTE(x) __has_attribute(x)
00429 #else
00430 #   define UPRV_HAS_ATTRIBUTE(x) 0
00431 #endif
00432 #ifdef __has_cpp_attribute
00433 #   define UPRV_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
00434 #else
00435 #   define UPRV_HAS_CPP_ATTRIBUTE(x) 0
00436 #endif
00437 #ifdef __has_declspec_attribute
00438 #   define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
00439 #else
00440 #   define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) 0
00441 #endif
00442 #ifdef __has_builtin
00443 #   define UPRV_HAS_BUILTIN(x) __has_builtin(x)
00444 #else
00445 #   define UPRV_HAS_BUILTIN(x) 0
00446 #endif
00447 #ifdef __has_feature
00448 #   define UPRV_HAS_FEATURE(x) __has_feature(x)
00449 #else
00450 #   define UPRV_HAS_FEATURE(x) 0
00451 #endif
00452 #ifdef __has_extension
00453 #   define UPRV_HAS_EXTENSION(x) __has_extension(x)
00454 #else
00455 #   define UPRV_HAS_EXTENSION(x) 0
00456 #endif
00457 #ifdef __has_warning
00458 #   define UPRV_HAS_WARNING(x) __has_warning(x)
00459 #else
00460 #   define UPRV_HAS_WARNING(x) 0
00461 #endif
00462 
00463 
00464 #if defined(__clang__)
00465 #define UPRV_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
00466 #else
00467 #define UPRV_NO_SANITIZE_UNDEFINED
00468 #endif
00469 
00475 #if defined(__GNUC__) && __GNUC__>=3
00476 #    define U_MALLOC_ATTR __attribute__ ((__malloc__))
00477 #else
00478 #    define U_MALLOC_ATTR
00479 #endif
00480 
00486 #if (defined(__GNUC__) &&                                            \
00487         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
00488         UPRV_HAS_ATTRIBUTE(alloc_size)
00489 #   define U_ALLOC_SIZE_ATTR(X) __attribute__ ((alloc_size(X)))
00490 #   define U_ALLOC_SIZE_ATTR2(X,Y) __attribute__ ((alloc_size(X,Y)))
00491 #else
00492 #   define U_ALLOC_SIZE_ATTR(X)
00493 #   define U_ALLOC_SIZE_ATTR2(X,Y)
00494 #endif
00495 
00502 #ifdef U_CPLUSPLUS_VERSION
00503 #   if U_CPLUSPLUS_VERSION != 0 && !defined(__cplusplus)
00504 #       undef U_CPLUSPLUS_VERSION
00505 #       define U_CPLUSPLUS_VERSION 0
00506 #   endif
00507     /* Otherwise use the predefined value. */
00508 #elif !defined(__cplusplus)
00509 #   define U_CPLUSPLUS_VERSION 0
00510 #elif __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
00511 #   define U_CPLUSPLUS_VERSION 14
00512 #elif __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
00513 #   define U_CPLUSPLUS_VERSION 11
00514 #else
00515     // C++98 or C++03
00516 #   define U_CPLUSPLUS_VERSION 1
00517 #endif
00518 
00525 #ifndef __cplusplus
00526     // Not for C.
00527 #elif defined(U_FALLTHROUGH)
00528     // Use the predefined value.
00529 #elif defined(__clang__)
00530     // Test for compiler vs. feature separately.
00531     // Other compilers might choke on the feature test.
00532 #    if UPRV_HAS_CPP_ATTRIBUTE(clang::fallthrough) || \
00533              (UPRV_HAS_FEATURE(cxx_attributes) &&     \
00534              UPRV_HAS_WARNING("-Wimplicit-fallthrough"))
00535 #       define U_FALLTHROUGH [[clang::fallthrough]]
00536 #   endif
00537 #elif defined(__GNUC__) && (__GNUC__ >= 7)
00538 #   define U_FALLTHROUGH __attribute__((fallthrough))
00539 #endif
00540 
00541 #ifndef U_FALLTHROUGH
00542 #   define U_FALLTHROUGH
00543 #endif
00544 
00547 /*===========================================================================*/
00549 /*===========================================================================*/
00550 
00555 #define U_ASCII_FAMILY 0
00556 
00561 #define U_EBCDIC_FAMILY 1
00562 
00605 #ifdef U_CHARSET_FAMILY
00606     /* Use the predefined value. */
00607 #elif U_PLATFORM == U_PF_OS390 && (!defined(__CHARSET_LIB) || !__CHARSET_LIB)
00608 #   define U_CHARSET_FAMILY U_EBCDIC_FAMILY
00609 #elif U_PLATFORM == U_PF_OS400 && !defined(__UTF32__)
00610 #   define U_CHARSET_FAMILY U_EBCDIC_FAMILY
00611 #else
00612 #   define U_CHARSET_FAMILY U_ASCII_FAMILY
00613 #endif
00614 
00635 #ifdef U_CHARSET_IS_UTF8
00636     /* Use the predefined value. */
00637 #elif U_PLATFORM_IS_LINUX_BASED || U_PLATFORM_IS_DARWIN_BASED || \
00638         U_PLATFORM == U_PF_EMSCRIPTEN
00639 #   define U_CHARSET_IS_UTF8 1
00640 #else
00641 #   define U_CHARSET_IS_UTF8 0
00642 #endif
00643 
00646 /*===========================================================================*/
00648 /*===========================================================================*/
00649 
00656 #ifdef U_HAVE_WCHAR_H
00657     /* Use the predefined value. */
00658 #elif U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9
00659     /*
00660      * Android before Gingerbread (Android 2.3, API level 9) did not support wchar_t.
00661      * The type and header existed, but the library functions did not work as expected.
00662      * The size of wchar_t was 1 but L"xyz" string literals had 32-bit units anyway.
00663      */
00664 #   define U_HAVE_WCHAR_H 0
00665 #else
00666 #   define U_HAVE_WCHAR_H 1
00667 #endif
00668 
00675 #ifdef U_SIZEOF_WCHAR_T
00676     /* Use the predefined value. */
00677 #elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9)
00678     /*
00679      * Classic Mac OS and Mac OS X before 10.3 (Panther) did not support wchar_t or wstring.
00680      * Newer Mac OS X has size 4.
00681      */
00682 #   define U_SIZEOF_WCHAR_T 1
00683 #elif U_PLATFORM_HAS_WIN32_API || U_PLATFORM == U_PF_CYGWIN
00684 #   define U_SIZEOF_WCHAR_T 2
00685 #elif U_PLATFORM == U_PF_AIX
00686     /*
00687      * AIX 6.1 information, section "Wide character data representation":
00688      * "... the wchar_t datatype is 32-bit in the 64-bit environment and
00689      * 16-bit in the 32-bit environment."
00690      * and
00691      * "All locales use Unicode for their wide character code values (process code),
00692      * except the IBM-eucTW codeset."
00693      */
00694 #   ifdef __64BIT__
00695 #       define U_SIZEOF_WCHAR_T 4
00696 #   else
00697 #       define U_SIZEOF_WCHAR_T 2
00698 #   endif
00699 #elif U_PLATFORM == U_PF_OS390
00700     /*
00701      * z/OS V1R11 information center, section "LP64 | ILP32":
00702      * "In 31-bit mode, the size of long and pointers is 4 bytes and the size of wchar_t is 2 bytes.
00703      * Under LP64, the size of long and pointer is 8 bytes and the size of wchar_t is 4 bytes."
00704      */
00705 #   ifdef _LP64
00706 #       define U_SIZEOF_WCHAR_T 4
00707 #   else
00708 #       define U_SIZEOF_WCHAR_T 2
00709 #   endif
00710 #elif U_PLATFORM == U_PF_OS400
00711 #   if defined(__UTF32__)
00712         /*
00713          * LOCALETYPE(*LOCALEUTF) is specified.
00714          * Wide-character strings are in UTF-32,
00715          * narrow-character strings are in UTF-8.
00716          */
00717 #       define U_SIZEOF_WCHAR_T 4
00718 #   elif defined(__UCS2__)
00719         /*
00720          * LOCALETYPE(*LOCALEUCS2) is specified.
00721          * Wide-character strings are in UCS-2,
00722          * narrow-character strings are in EBCDIC.
00723          */
00724 #       define U_SIZEOF_WCHAR_T 2
00725 #   else
00726         /*
00727          * LOCALETYPE(*CLD) or LOCALETYPE(*LOCALE) is specified.
00728          * Wide-character strings are in 16-bit EBCDIC,
00729          * narrow-character strings are in EBCDIC.
00730          */
00731 #       define U_SIZEOF_WCHAR_T 2
00732 #   endif
00733 #else
00734 #   define U_SIZEOF_WCHAR_T 4
00735 #endif
00736 
00737 #ifndef U_HAVE_WCSCPY
00738 #define U_HAVE_WCSCPY U_HAVE_WCHAR_H
00739 #endif
00740 
00751 #ifdef U_HAVE_CHAR16_T
00752     /* Use the predefined value. */
00753 #else
00754     /*
00755      * Notes:
00756      * C++11 and C11 require support for UTF-16 literals
00757      * TODO: Fix for plain C. Doesn't work on Mac.
00758      */
00759 #   if U_CPLUSPLUS_VERSION >= 11 || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
00760 #       define U_HAVE_CHAR16_T 1
00761 #   else
00762 #       define U_HAVE_CHAR16_T 0
00763 #   endif
00764 #endif
00765 
00773 #ifdef U_DECLARE_UTF16
00774     /* Use the predefined value. */
00775 #elif U_HAVE_CHAR16_T \
00776     || (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
00777     || (defined(__HP_aCC) && __HP_aCC >= 035000) \
00778     || (defined(__HP_cc) && __HP_cc >= 111106) \
00779     || (defined(U_IN_DOXYGEN))
00780 #   define U_DECLARE_UTF16(string) u ## string
00781 #elif U_SIZEOF_WCHAR_T == 2 \
00782     && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
00783 #   define U_DECLARE_UTF16(string) L ## string
00784 #else
00785     /* Leave U_DECLARE_UTF16 undefined. See unistr.h. */
00786 #endif
00787 
00790 /*===========================================================================*/
00792 /*===========================================================================*/
00793 
00794 #ifdef U_EXPORT
00795     /* Use the predefined value. */
00796 #elif defined(U_STATIC_IMPLEMENTATION)
00797 #   define U_EXPORT
00798 #elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
00799                             UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
00800 #   define U_EXPORT __declspec(dllexport)
00801 #elif defined(__GNUC__)
00802 #   define U_EXPORT __attribute__((visibility("default")))
00803 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
00804    || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) 
00805 #   define U_EXPORT __global
00806 /*#elif defined(__HP_aCC) || defined(__HP_cc)
00807 #   define U_EXPORT __declspec(dllexport)*/
00808 #else
00809 #   define U_EXPORT
00810 #endif
00811 
00812 /* U_CALLCONV is related to U_EXPORT2 */
00813 #ifdef U_EXPORT2
00814     /* Use the predefined value. */
00815 #elif defined(_MSC_VER)
00816 #   define U_EXPORT2 __cdecl
00817 #else
00818 #   define U_EXPORT2
00819 #endif
00820 
00821 #ifdef U_IMPORT
00822     /* Use the predefined value. */
00823 #elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
00824                             UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
00825     /* Windows needs to export/import data. */
00826 #   define U_IMPORT __declspec(dllimport)
00827 #else
00828 #   define U_IMPORT 
00829 #endif
00830 
00838 #ifdef U_HIDDEN
00839     /* Use the predefined value. */
00840 #elif defined(__GNUC__)
00841 #   define U_HIDDEN __attribute__((visibility("hidden")))
00842 #else
00843 #   define U_HIDDEN 
00844 #endif
00845 
00863 #if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
00864 #    define U_CALLCONV __cdecl
00865 #else
00866 #    define U_CALLCONV U_EXPORT2
00867 #endif
00868 
00874 #if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
00875 #    define U_CALLCONV_FPTR U_CALLCONV
00876 #else
00877 #    define U_CALLCONV_FPTR
00878 #endif
00879 
00881 #endif  // _PLATFORM_H