Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

umachine.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 1999-2000, 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 
00038 /*===========================================================================*/
00039 /* Include platform-dependent definitions                                    */
00040 /* which are contained in the platform-specific file platform.h              */
00041 /*===========================================================================*/
00042 
00043 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
00044 #   include "unicode/pwin32.h"
00045 #elif defined(__OS2__)
00046 #   include "unicode/pos2.h"
00047 #elif defined(__OS400__)
00048 #   include "unicode/pos400.h"
00049 #elif defined(__MWERKS__)
00050 #   include "unicode/pmacos.h"
00051 #else
00052 #   include "unicode/platform.h"
00053 #endif
00054 
00055 /*===========================================================================*/
00056 /* XP_CPLUSPLUS is a cross-platform symbol which should be defined when      */
00057 /* using C++.  It should not be defined when compiling under C.              */
00058 /*===========================================================================*/
00059 
00060 #ifdef __cplusplus
00061 #   ifndef XP_CPLUSPLUS
00062 #       define XP_CPLUSPLUS
00063 #   endif
00064 #else
00065 #   undef XP_CPLUSPLUS
00066 #endif
00067 
00068 /*===========================================================================*/
00069 /* For C wrappers, we use the symbol U_CAPI.                                 */
00070 /* This works properly if the includer is C or C++.                          */
00071 /* Functions are declared   U_CAPI return-type U_EXPORT2 function-name() ... */
00072 /*===========================================================================*/
00073 
00074 #ifdef XP_CPLUSPLUS
00075 #   define U_CFUNC extern "C"
00076 #   define U_CDECL_BEGIN extern "C" {
00077 #   define U_CDECL_END   }
00078 #else
00079 #   define U_CFUNC extern
00080 #   define U_CDECL_BEGIN
00081 #   define U_CDECL_END
00082 #endif
00083 #define U_CAPI U_CFUNC U_EXPORT
00084 
00085 /*===========================================================================*/
00086 /* limits for int32_t etc., like in POSIX inttypes.h                         */
00087 /*===========================================================================*/
00088 
00089 #ifndef INT8_MIN
00090 #   define INT8_MIN        ((int8_t)(-128))
00091 #endif
00092 #ifndef INT16_MIN
00093 #   define INT16_MIN       ((int16_t)(-32767-1))
00094 #endif
00095 #ifndef INT32_MIN
00096 #   define INT32_MIN       ((int32_t)(-2147483647-1))
00097 #endif
00098 
00099 #ifndef INT8_MAX
00100 #   define INT8_MAX        ((int8_t)(127))
00101 #endif
00102 #ifndef INT16_MAX
00103 #   define INT16_MAX       ((int16_t)(32767))
00104 #endif
00105 #ifndef INT32_MAX
00106 #   define INT32_MAX       ((int32_t)(2147483647))
00107 #endif
00108 
00109 #ifndef UINT8_MAX
00110 #   define UINT8_MAX       ((uint8_t)(255U))
00111 #endif
00112 #ifndef UINT16_MAX
00113 #   define UINT16_MAX      ((uint16_t)(65535U))
00114 #endif
00115 #ifndef UINT32_MAX
00116 #   define UINT32_MAX      ((uint32_t)(4294967295U))
00117 #endif
00118 
00119 #if defined(__64BIT__) || defined(_LONG_LONG) || defined(_LP64) || defined(WIN64) || defined(_WIN64)
00120 #   ifndef INT64_MIN
00121 #       define INT64_MIN       ((int64_t)(-9223372036854775807-1))
00122 #   endif
00123 #   ifndef INT64_MAX
00124 #       define INT64_MAX       ((int64_t)(9223372036854775807))
00125 #   endif
00126 #   ifndef UINT64_MAX
00127 #       define UINT64_MAX      ((uint64_t)(18446744073709551615))
00128 #   endif
00129 #   ifndef INTMAX_MIN
00130 #       define INTMAX_MIN      INT64_MIN
00131 #   endif
00132 #   ifndef INTMAX_MAX
00133 #       define INTMAX_MAX      INT64_MAX
00134 #   endif
00135 #   ifndef UINTMAX_MAX
00136 #       define UINTMAX_MAX     UINT64_MAX
00137 #   endif
00138 #else
00139 #   ifndef INTMAX_MIN
00140 #       define INTMAX_MIN      INT32_MIN
00141 #   endif
00142 #   ifndef INTMAX_MAX
00143 #       define INTMAX_MAX      INT32_MAX
00144 #   endif
00145 #   ifndef UINTMAX_MAX
00146 #       define UINTMAX_MAX     UINT32_MAX
00147 #   endif
00148 #endif
00149 
00150 /*===========================================================================*/
00151 /* Boolean data type                                                         */
00152 /*===========================================================================*/
00153 
00154 #if !HAVE_BOOL_T
00155     typedef int8_t bool_t;
00156 #endif
00157 
00158 typedef int8_t UBool;
00159 
00160 #ifndef TRUE
00161 #   define TRUE  1
00162 #endif
00163 #ifndef FALSE
00164 #   define FALSE 0
00165 #endif
00166 
00167 #endif

Generated at Fri Dec 15 12:12:37 2000 for ICU 1.7 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000