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-2001, 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(__OS2__) 00047 # include "unicode/pos2.h" 00048 #elif defined(__OS400__) 00049 # include "unicode/pos400.h" 00050 #elif defined(__MWERKS__) 00051 # include "unicode/pmacos.h" 00052 #else 00053 # include "unicode/platform.h" 00054 #endif 00055 00056 /*===========================================================================*/ 00057 /* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */ 00058 /* using C++. It should not be defined when compiling under C. */ 00059 /*===========================================================================*/ 00060 00061 #ifdef __cplusplus 00062 # ifndef XP_CPLUSPLUS 00063 # define XP_CPLUSPLUS 00064 # endif 00065 #else 00066 # undef XP_CPLUSPLUS 00067 #endif 00068 00069 /*===========================================================================*/ 00070 /* For C wrappers, we use the symbol U_CAPI. */ 00071 /* This works properly if the includer is C or C++. */ 00072 /* Functions are declared U_CAPI return-type U_EXPORT2 function-name() ... */ 00073 /*===========================================================================*/ 00074 00075 #ifdef XP_CPLUSPLUS 00076 # define U_CFUNC extern "C" 00077 # define U_CDECL_BEGIN extern "C" { 00078 # define U_CDECL_END } 00079 #else 00080 # define U_CFUNC extern 00081 # define U_CDECL_BEGIN 00082 # define U_CDECL_END 00083 #endif 00084 00085 /* Define namespace symbols if the compiler supports it. */ 00086 #if U_HAVE_NAMESPACE 00087 # define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE { 00088 # define U_NAMESPACE_END } 00089 # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; 00090 # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: 00091 #else 00092 # define U_NAMESPACE_BEGIN 00093 # define U_NAMESPACE_END 00094 # define U_NAMESPACE_USE 00095 # define U_NAMESPACE_QUALIFIER 00096 #endif 00097 #define U_CAPI U_CFUNC U_EXPORT 00098 /*===========================================================================*/ 00099 /* limits for int32_t etc., like in POSIX inttypes.h */ 00100 /*===========================================================================*/ 00101 00102 #ifndef INT8_MIN 00103 # define INT8_MIN ((int8_t)(-128)) 00104 #endif 00105 #ifndef INT16_MIN 00106 # define INT16_MIN ((int16_t)(-32767-1)) 00107 #endif 00108 #ifndef INT32_MIN 00109 # define INT32_MIN ((int32_t)(-2147483647-1)) 00110 #endif 00111 00112 #ifndef INT8_MAX 00113 # define INT8_MAX ((int8_t)(127)) 00114 #endif 00115 #ifndef INT16_MAX 00116 # define INT16_MAX ((int16_t)(32767)) 00117 #endif 00118 #ifndef INT32_MAX 00119 # define INT32_MAX ((int32_t)(2147483647)) 00120 #endif 00121 00122 #ifndef UINT8_MAX 00123 # define UINT8_MAX ((uint8_t)(255U)) 00124 #endif 00125 #ifndef UINT16_MAX 00126 # define UINT16_MAX ((uint16_t)(65535U)) 00127 #endif 00128 #ifndef UINT32_MAX 00129 # define UINT32_MAX ((uint32_t)(4294967295U)) 00130 #endif 00131 00132 #if defined(__64BIT__) || defined(_LONG_LONG) || defined(_LP64) || defined(WIN64) || defined(_WIN64) 00133 # ifndef INT64_MIN 00134 # define INT64_MIN ((int64_t)(-9223372036854775807-1)) 00135 # endif 00136 # ifndef INT64_MAX 00137 # define INT64_MAX ((int64_t)(9223372036854775807)) 00138 # endif 00139 # ifndef UINT64_MAX 00140 # define UINT64_MAX ((uint64_t)(18446744073709551615)) 00141 # endif 00142 # ifndef INTMAX_MIN 00143 # define INTMAX_MIN INT64_MIN 00144 # endif 00145 # ifndef INTMAX_MAX 00146 # define INTMAX_MAX INT64_MAX 00147 # endif 00148 # ifndef UINTMAX_MAX 00149 # define UINTMAX_MAX UINT64_MAX 00150 # endif 00151 #else 00152 # ifndef INTMAX_MIN 00153 # define INTMAX_MIN INT32_MIN 00154 # endif 00155 # ifndef INTMAX_MAX 00156 # define INTMAX_MAX INT32_MAX 00157 # endif 00158 # ifndef UINTMAX_MAX 00159 # define UINTMAX_MAX UINT32_MAX 00160 # endif 00161 #endif 00162 00163 /*===========================================================================*/ 00164 /* Boolean data type */ 00165 /*===========================================================================*/ 00166 00167 typedef int8_t UBool; 00168 00169 #ifndef TRUE 00170 # define TRUE 1 00171 #endif 00172 #ifndef FALSE 00173 # define FALSE 0 00174 #endif 00175 00176 00177 /*===========================================================================*/ 00178 /* U_INLINE and U_ALIGN_CODE Set default vaues if these are not already */ 00179 /* defined. Definitions normally are in */ 00180 /* platform.h or the corresponding file for */ 00181 /* the OS in use. */ 00182 /*===========================================================================*/ 00183 #ifndef U_ALIGN_CODE 00184 # define U_ALIGN_CODE(n) 00185 #endif 00186 00187 #ifndef U_INLINE 00188 # define U_INLINE 00189 #endif 00190 00191 #include "unicode/urename.h" 00192 00193 #endif

Generated on Wed Jul 28 05:45:13 2004 for ICU 2.1 by doxygen 1.3.7