Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_CSTYPES_H__
00020 #define __CS_CSTYPES_H__
00021
00028 #include "csplatform.h"
00029 #include <float.h>
00030
00031 #if defined(CS_HAVE_STDINT_H)
00032 #ifndef __STDC_CONSTANT_MACROS
00033 #define __STDC_CONSTANT_MACROS
00034 #endif
00035 #ifndef __STDC_LIMIT_MACROS
00036 #define __STDC_LIMIT_MACROS
00037 #endif
00038 #include <stdint.h>
00039 #endif
00040
00041 #if defined(CS_HAVE_INTTYPES_H)
00042 #ifndef __STDC_FORMAT_MACROS
00043 #define __STDC_FORMAT_MACROS
00044 #endif
00045 #include <inttypes.h>
00046 #endif
00047
00056 #if !defined(CS_HAVE_STDINT_H) && !defined(CS_HAVE_INTTYPES_H)
00057
00058 typedef unsigned char uint8;
00060 typedef char int8;
00062 typedef unsigned short uint16;
00064 typedef short int16;
00066 typedef unsigned int uint32;
00068 typedef int int32;
00069 #if defined(CS_COMPILER_GCC)
00070 #ifndef __STRICT_ANSI__
00071
00072 typedef unsigned long long uint64;
00074 typedef long long int64;
00075 #endif
00076 #elif defined(CS_COMPILER_MSVC) || defined(CS_COMPILER_BCC)
00077
00078 typedef unsigned __int64 uint64;
00080 typedef __int64 int64;
00081 #else
00082 #error Do not know how to declare 64-bit integers
00083 #endif // CS_COMPILER_GCC
00084
00085 #else // CS_HAVE_STDINT_H || CS_HAVE_INTTYPES_H
00086
00087 typedef uint8_t uint8;
00088 typedef int8_t int8;
00089 typedef uint16_t uint16;
00090 typedef int16_t int16;
00091 typedef uint32_t uint32;
00092 typedef int32_t int32;
00093 typedef uint64_t uint64;
00094 typedef int64_t int64;
00095 #endif
00096
00097 #if defined(CS_HAVE_INT64_C) && defined(INT64_C)
00098
00104 #define CONST_INT64(x) INT64_C(x)
00105
00111 #define CONST_UINT64(x) UINT64_C(x)
00112
00113 #else // defined(CS_HAVE_INT64_C) && defined(INT64_C)
00114
00115 #if defined(CS_COMPILER_GCC)
00116 #define CONST_INT64(x) x ## LL
00117 #define CONST_UINT64(x) x ## ULL
00118 #elif defined(CS_COMPILER_MSVC) || defined(CS_COMPILER_BCC)
00119 #define CONST_INT64(x) x##i64
00120 #define CONST_UINT64(x) x##ui64
00121 #else
00122 #error Do not know how to contruct 64-bit integer constants
00123 #endif // CS_COMPILER_GCC
00124
00125 #endif // CS_HAVE_INT64_C
00126
00132
00133
00134
00135
00136
00137
00138
00139 #include <stddef.h>
00140 #if !defined(CS_HAVE_INTPTR_T) && !defined(_INTPTR_T_DEFINED)
00141
00142 #if CS_PROCESSOR_SIZE == 64
00143 typedef int64 intptr_t;
00144 typedef uint64 uintptr_t;
00145 typedef int64 ptrdiff_t;
00146 #else
00147
00148 typedef int intptr_t;
00150 typedef unsigned int uintptr_t;
00152 typedef int ptrdiff_t;
00153 #endif
00154
00155 #define _INTPTR_T_DEFINED
00156 #define _UINTPTR_T_DEFINED
00157 #define _PTRDIFF_T_DEFINED
00158 #endif
00159
00160 #if !defined(CS_HAVE_INTMAX_T)
00161
00162 typedef int64 intmax_t;
00164 typedef uint64 uintmax_t;
00165 #endif
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 #include <stddef.h>
00178 #if defined(CS_HAVE_WCHAR_H)
00179 #include <wchar.h>
00180 #endif
00181 #if defined(CS_HAVE_WCTYPE_H)
00182 #include <wctype.h>
00183 #endif
00184 #if !defined(CS_HAVE_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
00185 typedef uint16 wchar_t;
00186 #define _WCHAR_T_DEFINED
00187 #define CS_WCHAR_T_SIZE 2
00188 #endif
00189 #if !defined(CS_HAVE_WINT_T) && !defined(_WCTYPE_T_DEFINED) && \
00190 !defined(_WINT_T)
00191 typedef wchar_t wint_t;
00192 #define _WCTYPE_T_DEFINED
00193 #define _WINT_T
00194 #endif
00195
00196
00197 #if defined(CS_COMPILER_GCC)
00198 #ifndef __STRICT_ANSI__
00199
00202 typedef long long longlong;
00206 typedef unsigned long long ulonglong;
00207 #else
00208
00209 typedef int64 longlong;
00210 typedef uint64 ulonglong;
00211 #endif
00212 #elif defined(CS_COMPILER_MSVC) || defined(CS_COMPILER_BCC)
00213 typedef int64 longlong;
00214 typedef uint64 ulonglong;
00215 #else
00216 #ifdef CS_HAVE_STDINT_H
00217 typedef int_least64_t longlong;
00218 typedef uint_least64_t ulonglong;
00219 #else
00220 #error Do not know how to declare (u)longlong types
00221 #endif
00222 #endif
00223
00230 typedef unsigned int csTicks;
00231
00233 typedef unsigned int uint;
00238 #endif // __CS_CSTYPES_H__