platform.h

Go to the documentation of this file.
00001 /*
00002 ******************************************************************************
00003 *
00004 *   Copyright (C) 1997-2009, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 ******************************************************************************
00008 *
00009 *  FILE NAME : platform.h
00010 *
00011 *   Date        Name        Description
00012 *   05/13/98    nos         Creation (content moved here from ptypes.h).
00013 *   03/02/99    stephen     Added AS400 support.
00014 *   03/30/99    stephen     Added Linux support.
00015 *   04/13/99    stephen     Reworked for autoconf.
00016 ******************************************************************************
00017 */
00018 
00019 #ifndef _PLATFORM_H
00020 #define _PLATFORM_H
00021 
00027 /* Define the platform we're on. */
00028 #ifndef U_LINUX
00029 #define U_LINUX
00030 #endif
00031 
00035 #ifndef U_HAVE_DIRENT_H
00036 #define U_HAVE_DIRENT_H 1
00037 #endif
00038 
00040 #ifndef U_HAVE_INTTYPES_H
00041 #define U_HAVE_INTTYPES_H 1
00042 #endif
00043 
00058 #ifndef U_IOSTREAM_SOURCE
00059 #define U_IOSTREAM_SOURCE 199711
00060 #endif
00061 
00070 #ifndef U_HAVE_STD_STRING
00071 #define U_HAVE_STD_STRING 1
00072 #endif
00073 
00075 #ifndef U_HAVE_INT8_T
00076 #define U_HAVE_INT8_T 1
00077 #endif
00078 
00079 #ifndef U_HAVE_UINT8_T
00080 #define U_HAVE_UINT8_T 1
00081 #endif
00082 
00083 #ifndef U_HAVE_INT16_T
00084 #define U_HAVE_INT16_T 1
00085 #endif
00086 
00087 #ifndef U_HAVE_UINT16_T
00088 #define U_HAVE_UINT16_T 1
00089 #endif
00090 
00091 #ifndef U_HAVE_INT32_T
00092 #define U_HAVE_INT32_T 1
00093 #endif
00094 
00095 #ifndef U_HAVE_UINT32_T
00096 #define U_HAVE_UINT32_T 1
00097 #endif
00098 
00099 #ifndef U_HAVE_INT64_T
00100 #define U_HAVE_INT64_T 1
00101 #endif
00102 
00103 #ifndef U_HAVE_UINT64_T
00104 #define U_HAVE_UINT64_T 1
00105 #endif
00106 
00109 /*===========================================================================*/
00111 /*===========================================================================*/
00112 
00113 #include <sys/types.h>
00114 
00115 /* If your platform does not have the <inttypes.h> header, you may
00116    need to edit the typedefs below. */
00117 #if U_HAVE_INTTYPES_H
00118 
00119 /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
00120 /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
00121 /* doesn't have uint8_t depending on the OS version. */
00122 /* So we have this work around. */
00123 #ifdef OS390
00124 /* The features header is needed to get (u)int64_t sometimes. */
00125 #include <features.h>
00126 #if ! U_HAVE_INT8_T
00127 typedef signed char int8_t;
00128 #endif
00129 #if !defined(__uint8_t)
00130 #define __uint8_t 1
00131 typedef unsigned char uint8_t;
00132 #endif
00133 #endif /* OS390 */
00134 
00135 #include <inttypes.h>
00136 
00137 #else /* U_HAVE_INTTYPES_H */
00138 
00139 #if ! U_HAVE_INT8_T
00140 typedef signed char int8_t;
00141 #endif
00142 
00143 #if ! U_HAVE_UINT8_T
00144 typedef unsigned char uint8_t;
00145 #endif
00146 
00147 #if ! U_HAVE_INT16_T
00148 typedef signed short int16_t;
00149 #endif
00150 
00151 #if ! U_HAVE_UINT16_T
00152 typedef unsigned short uint16_t;
00153 #endif
00154 
00155 #if ! U_HAVE_INT32_T
00156 typedef signed int int32_t;
00157 #endif
00158 
00159 #if ! U_HAVE_UINT32_T
00160 typedef unsigned int uint32_t;
00161 #endif
00162 
00163 #if ! U_HAVE_INT64_T
00164     typedef signed long long int64_t;
00165 /* else we may not have a 64-bit type */
00166 #endif
00167 
00168 #if ! U_HAVE_UINT64_T
00169     typedef unsigned long long uint64_t;
00170 /* else we may not have a 64-bit type */
00171 #endif
00172 
00173 #endif
00174 
00177 /*===========================================================================*/
00179 /*===========================================================================*/
00180 
00181 /* Define whether namespace is supported */
00182 #ifndef U_HAVE_NAMESPACE
00183 #define U_HAVE_NAMESPACE 1
00184 #endif
00185 
00186 /* Determines the endianness of the platform
00187    It's done this way in case multiple architectures are being built at once.
00188    For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
00189 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
00190 #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
00191 #else
00192 #define U_IS_BIG_ENDIAN 0
00193 #endif
00194 
00195 /* 1 or 0 to enable or disable threads.  If undefined, default is: enable threads. */
00196 #define ICU_USE_THREADS 1
00197 
00198 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
00199 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
00200 #define UMTX_STRONG_MEMORY_MODEL 1
00201 #endif
00202 
00203 #ifndef U_DEBUG
00204 #define U_DEBUG 0
00205 #endif
00206 
00207 #ifndef U_RELEASE
00208 #define U_RELEASE 1
00209 #endif
00210 
00211 /* Determine whether to disable renaming or not. This overrides the
00212    setting in umachine.h which is for all platforms. */
00213 #ifndef U_DISABLE_RENAMING
00214 #define U_DISABLE_RENAMING 0
00215 #endif
00216 
00217 /* Determine whether to override new and delete. */
00218 #ifndef U_OVERRIDE_CXX_ALLOCATION
00219 #define U_OVERRIDE_CXX_ALLOCATION 1
00220 #endif
00221 /* Determine whether to override placement new and delete for STL. */
00222 #ifndef U_HAVE_PLACEMENT_NEW
00223 #define U_HAVE_PLACEMENT_NEW 1
00224 #endif
00225 
00226 /* Determine whether to enable tracing. */
00227 #ifndef U_ENABLE_TRACING
00228 #define U_ENABLE_TRACING 0
00229 #endif
00230 
00231 /* Do we allow ICU users to use the draft APIs by default? */
00232 #ifndef U_DEFAULT_SHOW_DRAFT
00233 #define U_DEFAULT_SHOW_DRAFT 1
00234 #endif
00235 
00236 /* Define the library suffix in a C syntax. */
00237 #define U_HAVE_LIB_SUFFIX 0
00238 #define U_LIB_SUFFIX_C_NAME 
00239 #define U_LIB_SUFFIX_C_NAME_STRING ""
00240 
00243 /*===========================================================================*/
00245 /*===========================================================================*/
00246 
00247 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
00248 #   define U_CHARSET_FAMILY 1
00249 #endif
00250 
00253 /*===========================================================================*/
00255 /*===========================================================================*/
00256 
00257 #ifndef U_HAVE_WCHAR_H
00258 #define U_HAVE_WCHAR_H      1
00259 #endif
00260 
00261 #ifndef U_SIZEOF_WCHAR_T
00262 #define U_SIZEOF_WCHAR_T    4
00263 #endif
00264 
00265 #ifndef U_HAVE_WCSCPY
00266 #define U_HAVE_WCSCPY       1
00267 #endif
00268 
00278 #if 1 || defined(U_CHECK_UTF16_STRING)
00279 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
00280     || (defined(__HP_aCC) && __HP_aCC >= 035000) \
00281     || (defined(__HP_cc) && __HP_cc >= 111106)
00282 #define U_DECLARE_UTF16(string) u ## string
00283 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
00284 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
00285 /* Sun's C compiler has issues with this notation, and it's unreliable. */
00286 #define U_DECLARE_UTF16(string) U ## string
00287 #elif U_SIZEOF_WCHAR_T == 2 \
00288     && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
00289 #define U_DECLARE_UTF16(string) L ## string
00290 #endif
00291 #endif
00292 
00295 /*===========================================================================*/
00297 /*===========================================================================*/
00298 
00299 #ifndef U_HAVE_NL_LANGINFO_CODESET
00300 #define U_HAVE_NL_LANGINFO_CODESET  1
00301 #endif
00302 
00303 #ifndef U_NL_LANGINFO_CODESET
00304 #define U_NL_LANGINFO_CODESET       CODESET
00305 #endif
00306 
00307 #if 1
00308 #define U_TZSET         tzset
00309 #endif
00310 #if 1
00311 #define U_TIMEZONE      __timezone
00312 #endif
00313 #if 1
00314 #define U_TZNAME        tzname
00315 #endif
00316 
00317 #define U_HAVE_MMAP     1
00318 #define U_HAVE_POPEN    1
00319 
00322 /*===========================================================================*/
00324 /*===========================================================================*/
00325 
00326 #if 1
00327 #define U_EXPORT __attribute__((visibility("default")))
00328 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
00329    || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) 
00330 #define U_EXPORT __global
00331 /*#elif defined(__HP_aCC) || defined(__HP_cc)
00332 #define U_EXPORT __declspec(dllexport)*/
00333 #else
00334 #define U_EXPORT
00335 #endif
00336 
00337 /* U_CALLCONV is releated to U_EXPORT2 */
00338 #define U_EXPORT2
00339 
00340 /* cygwin needs to export/import data */
00341 #ifdef U_CYGWIN
00342 #define U_IMPORT __declspec(dllimport)
00343 #else
00344 #define U_IMPORT 
00345 #endif
00346 
00347 /* @} */
00348 
00349 /*===========================================================================*/
00351 /*===========================================================================*/
00352 
00353 #ifndef U_INLINE
00354 #   ifdef __cplusplus
00355 #       define U_INLINE inline
00356 #   else
00357 #       define U_INLINE __inline__
00358 #   endif
00359 #endif
00360 
00361 #ifndef U_ALIGN_CODE
00362 #define U_ALIGN_CODE(n) 
00363 #endif
00364 
00367 /*===========================================================================*/
00369 /*===========================================================================*/
00370 
00375 #ifndef U_MAKE
00376 #define U_MAKE  "/usr/bin/gmake"
00377 #endif
00378 
00381 #endif

Generated on 18 Sep 2013 for ICU 4.2.1 by  doxygen 1.4.7