Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

umachine.h

Go to the documentation of this file.
00001 /*
00002 ******************************************************************************
00003 *
00004 *   Copyright (C) 1999-2002, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 ******************************************************************************
00008 *   file name:  umachine.h
00009 *   encoding:   US-ASCII
00010 *   tab size:   8 (not used)
00011 *   indentation:4
00012 *
00013 *   created on: 1999sep13
00014 *   created by: Markus W. Scherer
00015 *
00016 *   This file defines basic types and constants for utf.h to be
00017 *   platform-independent. umachine.h and utf.h are included into
00018 *   utypes.h to provide all the general definitions for ICU.
00019 *   All of these definitions used to be in utypes.h before
00020 *   the UTF-handling macros made this unmaintainable.
00021 */
00022 
00023 #ifndef __UMACHINE_H__
00024 #define __UMACHINE_H__
00025 
00026 
00039 /*==========================================================================*/
00040 /* Include platform-dependent definitions                                   */
00041 /* which are contained in the platform-specific file platform.h             */
00042 /*==========================================================================*/
00043 
00044 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
00045 #   include "unicode/pwin32.h"
00046 #elif defined(__OS400__)
00047 #   include "unicode/pos400.h"
00048 #elif defined(__MWERKS__)
00049 #   include "unicode/pmacos.h"
00050 #else
00051 #   include "unicode/platform.h"
00052 #endif
00053 
00054 /*==========================================================================*/
00055 /* XP_CPLUSPLUS is a cross-platform symbol which should be defined when     */
00056 /* using C++.  It should not be defined when compiling under C.             */
00057 /*==========================================================================*/
00058 
00059 #ifdef __cplusplus
00060 #   ifndef XP_CPLUSPLUS
00061 #       define XP_CPLUSPLUS
00062 #   endif
00063 #else
00064 #   undef XP_CPLUSPLUS
00065 #endif
00066 
00067 /*==========================================================================*/
00068 /* For C wrappers, we use the symbol U_CAPI.                                */
00069 /* This works properly if the includer is C or C++.                         */
00070 /* Functions are declared   U_CAPI return-type U_EXPORT2 function-name()... */
00071 /*==========================================================================*/
00072 
00091 #ifdef XP_CPLUSPLUS
00092 #   define U_CFUNC extern "C"
00093 #   define U_CDECL_BEGIN extern "C" {
00094 #   define U_CDECL_END   }
00095 #else
00096 #   define U_CFUNC extern
00097 #   define U_CDECL_BEGIN
00098 #   define U_CDECL_END
00099 #endif
00100 
00131 /* Define namespace symbols if the compiler supports it. */
00132 #if U_HAVE_NAMESPACE
00133 #   define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
00134 #   define U_NAMESPACE_END  }
00135 #   define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
00136 #   define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
00137 #else
00138 #   define U_NAMESPACE_BEGIN
00139 #   define U_NAMESPACE_END
00140 #   define U_NAMESPACE_USE
00141 #   define U_NAMESPACE_QUALIFIER
00142 #endif
00143 
00145 #define U_CAPI U_CFUNC U_EXPORT
00146 
00147 /*==========================================================================*/
00148 /* limits for int32_t etc., like in POSIX inttypes.h                        */
00149 /*==========================================================================*/
00150 
00151 #ifndef INT8_MIN
00152 
00153 #   define INT8_MIN        ((int8_t)(-128))
00154 #endif
00155 #ifndef INT16_MIN
00156 
00157 #   define INT16_MIN       ((int16_t)(-32767-1))
00158 #endif
00159 #ifndef INT32_MIN
00160 
00161 #   define INT32_MIN       ((int32_t)(-2147483647-1))
00162 #endif
00163 
00164 #ifndef INT8_MAX
00165 
00166 #   define INT8_MAX        ((int8_t)(127))
00167 #endif
00168 #ifndef INT16_MAX
00169 
00170 #   define INT16_MAX       ((int16_t)(32767))
00171 #endif
00172 #ifndef INT32_MAX
00173 
00174 #   define INT32_MAX       ((int32_t)(2147483647))
00175 #endif
00176 
00177 #ifndef UINT8_MAX
00178 
00179 #   define UINT8_MAX       ((uint8_t)(255U))
00180 #endif
00181 #ifndef UINT16_MAX
00182 
00183 #   define UINT16_MAX      ((uint16_t)(65535U))
00184 #endif
00185 #ifndef UINT32_MAX
00186 
00187 #   define UINT32_MAX      ((uint32_t)(4294967295U))
00188 #endif
00189 
00190 #if defined(U_INT64_T_UNAVAILABLE)
00191 #   ifndef INTMAX_MIN
00192 #       define INTMAX_MIN      INT32_MIN
00193 #   endif
00194 #   ifndef INTMAX_MAX
00195 #       define INTMAX_MAX      INT32_MAX
00196 #   endif
00197 #   ifndef UINTMAX_MAX
00198 #       define UINTMAX_MAX     UINT32_MAX
00199 #   endif
00200 #else
00201 #   ifndef INT64_MIN
00202 
00203 #       define INT64_MIN       ((int64_t)(-9223372036854775807-1))
00204 #   endif
00205 #   ifndef INT64_MAX
00206 
00207 #       define INT64_MAX       ((int64_t)(9223372036854775807))
00208 #   endif
00209 #   ifndef UINT64_MAX
00210 
00211 #       define UINT64_MAX      ((uint64_t)(18446744073709551615))
00212 #   endif
00213 #   ifndef INTMAX_MIN
00214 #       define INTMAX_MIN      INT64_MIN
00215 #   endif
00216 #   ifndef INTMAX_MAX
00217 #       define INTMAX_MAX      INT64_MAX
00218 #   endif
00219 #   ifndef UINTMAX_MAX
00220 #       define UINTMAX_MAX     UINT64_MAX
00221 #   endif
00222 #endif
00223 
00224 /*==========================================================================*/
00225 /* Boolean data type                                                        */
00226 /*==========================================================================*/
00227 
00229 typedef int8_t UBool;
00230 
00231 #ifndef TRUE
00232 
00233 #   define TRUE  1
00234 #endif
00235 #ifndef FALSE
00236 
00237 #   define FALSE 0
00238 #endif
00239 
00240 
00241 /*==========================================================================*/
00242 /* U_INLINE and U_ALIGN_CODE   Set default values if these are not already  */
00243 /*                             defined.  Definitions normally are in        */
00244 /*                             platform.h or the corresponding file for     */
00245 /*                             the OS in use.                               */
00246 /*==========================================================================*/
00247 
00254 #ifndef U_ALIGN_CODE
00255 #   define U_ALIGN_CODE(n)
00256 #endif
00257 
00258 #ifndef U_INLINE
00259 #   define U_INLINE
00260 #endif
00261 
00262 #include "unicode/urename.h"
00263 
00264 #endif

Generated on Wed Sep 3 17:47:10 2003 for ICU 2.6 by doxygen 1.3.2