platform.h

Go to the documentation of this file.
00001 /*
00002 ******************************************************************************
00003 *
00004 *   Copyright (C) 1997-2007, 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 
00024 /* Define the platform we're on. */
00025 #ifndef U_LINUX
00026 #define U_LINUX
00027 #endif
00028 
00029 /* Define whether inttypes.h is available */
00030 #ifndef U_HAVE_INTTYPES_H
00031 #define U_HAVE_INTTYPES_H 1
00032 #endif
00033 
00034 /*
00035  * Define what support for C++ streams is available.
00036  *     If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
00037  * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
00038  * one should qualify streams using the std namespace in ICU header
00039  * files.
00040  *     If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
00041  * available instead (198506 is the date when Stroustrup published
00042  * "An Extensible I/O Facility for C++" at the summer USENIX conference).
00043  *     If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
00044  * support for them will be silently suppressed in ICU.
00045  *
00046  */
00047 
00048 #ifndef U_IOSTREAM_SOURCE
00049 #define U_IOSTREAM_SOURCE 199711
00050 #endif
00051 
00052 /* Determines whether specific types are available */
00053 #ifndef U_HAVE_INT8_T
00054 #define U_HAVE_INT8_T 1
00055 #endif
00056 
00057 #ifndef U_HAVE_UINT8_T
00058 #define U_HAVE_UINT8_T 1
00059 #endif
00060 
00061 #ifndef U_HAVE_INT16_T
00062 #define U_HAVE_INT16_T 1
00063 #endif
00064 
00065 #ifndef U_HAVE_UINT16_T
00066 #define U_HAVE_UINT16_T 1
00067 #endif
00068 
00069 #ifndef U_HAVE_INT32_T
00070 #define U_HAVE_INT32_T 1
00071 #endif
00072 
00073 #ifndef U_HAVE_UINT32_T
00074 #define U_HAVE_UINT32_T 1
00075 #endif
00076 
00077 #ifndef U_HAVE_INT64_T
00078 #define U_HAVE_INT64_T 1
00079 #endif
00080 
00081 #ifndef U_HAVE_UINT64_T
00082 #define U_HAVE_UINT64_T 1
00083 #endif
00084 
00085 /*===========================================================================*/
00086 /* Generic data types                                                        */
00087 /*===========================================================================*/
00088 
00089 #include <sys/types.h>
00090 
00091 /* If your platform does not have the <inttypes.h> header, you may
00092    need to edit the typedefs below. */
00093 #if U_HAVE_INTTYPES_H
00094 
00095 /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
00096 /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
00097 /* doesn't have uint8_t depending on the OS version. */
00098 /* So we have this work around. */
00099 #ifdef OS390
00100 /* The features header is needed to get (u)int64_t sometimes. */
00101 #include <features.h>
00102 #if ! U_HAVE_INT8_T
00103 typedef signed char int8_t;
00104 #endif
00105 #if !defined(__uint8_t)
00106 #define __uint8_t 1
00107 typedef unsigned char uint8_t;
00108 #endif
00109 #endif /* OS390 */
00110 
00111 #include <inttypes.h>
00112 
00113 #else /* U_HAVE_INTTYPES_H */
00114 
00115 #if ! U_HAVE_INT8_T
00116 typedef signed char int8_t;
00117 #endif
00118 
00119 #if ! U_HAVE_UINT8_T
00120 typedef unsigned char uint8_t;
00121 #endif
00122 
00123 #if ! U_HAVE_INT16_T
00124 typedef signed short int16_t;
00125 #endif
00126 
00127 #if ! U_HAVE_UINT16_T
00128 typedef unsigned short uint16_t;
00129 #endif
00130 
00131 #if ! U_HAVE_INT32_T
00132 typedef signed int int32_t;
00133 #endif
00134 
00135 #if ! U_HAVE_UINT32_T
00136 typedef unsigned int uint32_t;
00137 #endif
00138 
00139 #if ! U_HAVE_INT64_T
00140     typedef signed long long int64_t;
00141 /* else we may not have a 64-bit type */
00142 #endif
00143 
00144 #if ! U_HAVE_UINT64_T
00145     typedef unsigned long long uint64_t;
00146 /* else we may not have a 64-bit type */
00147 #endif
00148 
00149 #endif
00150 
00151 /*===========================================================================*/
00152 /* Compiler and environment features                                         */
00153 /*===========================================================================*/
00154 
00155 /* Define whether namespace is supported */
00156 #ifndef U_HAVE_NAMESPACE
00157 #define U_HAVE_NAMESPACE 1
00158 #endif
00159 
00160 /* Determines the endianness of the platform
00161    It's done this way in case multiple architectures are being built at once.
00162    For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
00163 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
00164 #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
00165 #else
00166 #define U_IS_BIG_ENDIAN 0
00167 #endif
00168 
00169 /* 1 or 0 to enable or disable threads.  If undefined, default is: enable threads. */
00170 #define ICU_USE_THREADS 1
00171 
00172 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
00173 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
00174 #define UMTX_STRONG_MEMORY_MODEL 1
00175 #endif
00176 
00177 #ifndef U_DEBUG
00178 #define U_DEBUG 0
00179 #endif
00180 
00181 #ifndef U_RELEASE
00182 #define U_RELEASE 1
00183 #endif
00184 
00185 /* Determine whether to disable renaming or not. This overrides the
00186    setting in umachine.h which is for all platforms. */
00187 #ifndef U_DISABLE_RENAMING
00188 #define U_DISABLE_RENAMING 0
00189 #endif
00190 
00191 /* Determine whether to override new and delete. */
00192 #ifndef U_OVERRIDE_CXX_ALLOCATION
00193 #define U_OVERRIDE_CXX_ALLOCATION 1
00194 #endif
00195 /* Determine whether to override placement new and delete for STL. */
00196 #ifndef U_HAVE_PLACEMENT_NEW
00197 #define U_HAVE_PLACEMENT_NEW 1
00198 #endif
00199 
00200 /* Determine whether to enable tracing. */
00201 #ifndef U_ENABLE_TRACING
00202 #define U_ENABLE_TRACING 0
00203 #endif
00204 
00205 /* Do we allow ICU users to use the draft APIs by default? */
00206 #ifndef U_DEFAULT_SHOW_DRAFT
00207 #define U_DEFAULT_SHOW_DRAFT 1
00208 #endif
00209 
00210 /* Define the library suffix in a C syntax. */
00211 #define U_HAVE_LIB_SUFFIX 0
00212 #define U_LIB_SUFFIX_C_NAME 
00213 #define U_LIB_SUFFIX_C_NAME_STRING ""
00214 
00215 /*===========================================================================*/
00216 /* Character data types                                                      */
00217 /*===========================================================================*/
00218 
00219 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
00220 #   define U_CHARSET_FAMILY 1
00221 #endif
00222 
00223 /*===========================================================================*/
00224 /* Information about wchar support                                           */
00225 /*===========================================================================*/
00226 
00227 #define U_HAVE_WCHAR_H      1
00228 #define U_SIZEOF_WCHAR_T    4
00229 
00230 #define U_HAVE_WCSCPY       1
00231 
00238 #if 1 || defined(U_CHECK_UTF16_STRING)
00239 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
00240     || (defined(__HP_aCC) && __HP_aCC >= 035000) \
00241     || (defined(__HP_cc) && __HP_cc >= 111106)
00242 #define U_DECLARE_UTF16(string) u ## string
00243 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
00244 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
00245 /* Sun's C compiler has issues with this notation, and it's unreliable. */
00246 #define U_DECLARE_UTF16(string) U ## string
00247 #elif U_SIZEOF_WCHAR_T == 2 \
00248     && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
00249 #define U_DECLARE_UTF16(string) L ## string
00250 #endif
00251 #endif
00252 
00253 /*===========================================================================*/
00254 /* Information about POSIX support                                           */
00255 /*===========================================================================*/
00256 
00257 #define U_HAVE_NL_LANGINFO_CODESET  1
00258 #define U_NL_LANGINFO_CODESET       CODESET
00259 
00260 #if 1
00261 #define U_TZSET         tzset
00262 #endif
00263 #if 1
00264 #define U_TIMEZONE      timezone
00265 #endif
00266 #if 1
00267 #define U_TZNAME        tzname
00268 #endif
00269 
00270 #define U_HAVE_MMAP     1
00271 #define U_HAVE_POPEN    1
00272 
00273 /*===========================================================================*/
00274 /* Symbol import-export control                                              */
00275 /*===========================================================================*/
00276 
00277 #if 1
00278 #define U_EXPORT __attribute__((visibility("default")))
00279 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
00280    || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550) 
00281 #define U_EXPORT __global
00282 /*#elif defined(__HP_aCC) || defined(__HP_cc)
00283 #define U_EXPORT __declspec(dllexport)*/
00284 #else
00285 #define U_EXPORT
00286 #endif
00287 
00288 /* U_CALLCONV is releated to U_EXPORT2 */
00289 #define U_EXPORT2
00290 
00291 /* cygwin needs to export/import data */
00292 #ifdef U_CYGWIN
00293 #define U_IMPORT __declspec(dllimport)
00294 #else
00295 #define U_IMPORT 
00296 #endif
00297 
00298 /*===========================================================================*/
00299 /* Code alignment and C function inlining                                    */
00300 /*===========================================================================*/
00301 
00302 #ifndef U_INLINE
00303 #   ifdef __cplusplus
00304 #       define U_INLINE inline
00305 #   else
00306 #       define U_INLINE inline
00307 #   endif
00308 #endif
00309 
00310 #define U_ALIGN_CODE(n) 
00311 
00312 /*===========================================================================*/
00313 /* Programs used by ICU code                                                 */
00314 /*===========================================================================*/
00315 
00316 #define U_MAKE  "/usr/bin/gmake"

Generated on Sat Oct 3 23:25:33 2009 for ICU 4.0 by  doxygen 1.4.7