00001
00004 #ifndef FBXFILESDK_COMPONENTS_KBASELIB_KARCH_TYPES_H
00005 #define FBXFILESDK_COMPONENTS_KBASELIB_KARCH_TYPES_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/components/kbaselib/karch/arch.h>
00042
00043 #include <float.h>
00044 #include <stddef.h>
00045
00046
00047
00048 typedef void* kPointer;
00049 typedef signed char kByte;
00050 typedef unsigned char kUByte;
00051 typedef signed char kSChar;
00052 typedef unsigned char kUChar;
00053 typedef unsigned int kUInt;
00054 typedef signed short kShort;
00055 typedef unsigned short kUShort;
00056
00057 typedef double kVector3[3];
00058 typedef double kVector4[4];
00059
00060 #define K_SCHAR_MIN (-128)
00061 #define K_SCHAR_MAX (127)
00062 #define K_UCHAR_MIN (0)
00063 #define K_UCHAR_MAX (255)
00064
00065 #define K_INT8_MIN (-128)
00066 #define K_INT8_MAX (127)
00067 #define K_UINT8_MIN (0)
00068 #define K_UINT8_MAX (255)
00069
00070 #define K_INT16_MIN (-32768)
00071 #define K_INT16_MAX (32767)
00072 #define K_UINT16_MIN (0)
00073 #define K_UINT16_MAX (65535)
00074
00075 #define K_INT32_MIN (0x80000000)
00076 #define K_INT32_MAX (0x7fffffff)
00077 #define K_UINT32_MIN (0)
00078 #define K_UINT32_MAX (0xffffffff)
00079
00080 #if defined (KARCH_ARCH_POWERPC)
00081 #define KARCH_BIG_ENDIAN
00082 #else
00083 #define KARCH_LITTLE_ENDIAN
00084 #endif
00085
00086 #define K_CHAR(x) char(x)
00087 #define K_SCHAR(x) kSChar(x)
00088 #define K_UCHAR(x) kUChar(x##L)
00089
00090 #if defined(KARCH_ENV_WIN64)
00091 typedef unsigned short kWChar;
00092 #else
00093 typedef wchar_t kWChar;
00094 #endif
00095
00096 #define K_WCHAR(x) kWChar(x)
00097 #define K_WCHAR_MIN K_WCHAR(0)
00098 #define K_WCHAR_MAX K_WCHAR(65535)
00099 typedef kWChar * kWCharPtr;
00100
00101 typedef char* kTCharPtr;
00102 #ifndef _T
00103 #define __T(x) x
00104 #define _T(x) __T(x)
00105 #endif
00106
00107 #define K_SHORT(x) kShort(x)
00108 #define K_USHORT(x) kUShort(x##U)
00109 #define K_SHORT_MIN K_SHORT(-32768)
00110 #define K_SHORT_MAX K_SHORT(32767)
00111 #define K_USHORT_MIN K_USHORT(0)
00112 #define K_USHORT_MAX K_USHORT(65535)
00113
00114 #define K_INT(x) (x)
00115 #define K_UINT(x) (x##U)
00116 #define K_INT_MIN K_INT(0x80000000)
00117 #define K_INT_MAX K_INT(0x7fffffff)
00118 #define K_UINT_MIN K_UINT(0)
00119 #define K_UINT_MAX K_UINT(0xffffffff)
00120
00121 typedef signed long kLong;
00122 #define K_LONG(x) (x)
00123 typedef unsigned long kULong;
00124 #define K_ULONG(x) (x##U)
00125 #define K_LONG_MIN K_LONG(0x80000000)
00126 #define K_LONG_MAX K_LONG(0x7fffffff)
00127 #define K_ULONG_MIN K_ULONG(0)
00128 #define K_ULONG_MAX K_ULONG(0xffffffff)
00129
00130 #if defined(KARCH_DEV_MSC) && !defined(KARCH_DEV_INTEL)
00131 typedef signed __int64 kLongLong;
00132 #define K_LONGLONG(x) (x##i64)
00133 typedef unsigned __int64 kULongLong;
00134 #define K_ULONGLONG(x) (x##Ui64)
00135 #else
00136 typedef signed long long kLongLong;
00137 #define K_LONGLONG(x) (x##LL)
00138 typedef unsigned long long kULongLong;
00139 #define K_ULONGLONG(x) (x##ULL)
00140 #endif
00141
00142 #define K_LONGLONG_MIN K_LONGLONG(0x8000000000000000)
00143 #define K_LONGLONG_MAX K_LONGLONG(0x7fffffffffffffff)
00144 #define K_ULONGLONG_MIN K_ULONGLONG(0)
00145 #define K_ULONGLONG_MAX K_ULONGLONG(0xffffffffffffffff)
00146
00147 #define K_FLOAT(x) (x##F)
00148 #define K_FLOAT_MIN FLT_MIN // minimum positive value
00149 #define K_FLOAT_MAX FLT_MAX // maximum positive value
00150
00151 #define K_DOUBLE(x) (x)
00152 #define K_DOUBLE_MIN DBL_MIN // minimum positive value
00153 #define K_DOUBLE_MAX DBL_MAX // maximum positive value
00154
00155 typedef kSChar kInt8;
00156 typedef kUChar kUInt8;
00157
00158 typedef kShort kInt16;
00159 typedef kUShort kUInt16;
00160
00161 typedef int kInt32;
00162 typedef kUInt kUInt32;
00163
00164 typedef kLongLong kInt64;
00165 typedef kULongLong kUInt64;
00166 #define K_INT64_MIN K_LONGLONG_MIN
00167 #define K_INT64_MAX K_LONGLONG_MAX
00168 #define K_UINT64_MIN K_ULONGLONG_MIN
00169 #define K_UINT64_MAX K_ULONGLONG_MAX
00170
00171 #ifdef KARCH_DEV_MSC
00172 #define K_TEMPLATE_SPEC(t)
00173 #define K_TEMPLATE_SPEC2(t1, t2)
00174 #define K_INLINE inline
00175 #ifdef _DEBUG
00176 #define K_FORCEINLINE K_INLINE
00177 #else
00178 #define K_FORCEINLINE __forceinline
00179 #endif
00180 #else
00181 #define K_TEMPLATE_SPEC(t) template<>
00182 #define K_TEMPLATE_SPEC2(t1, t2)
00183 #define K_INLINE inline
00184 #define K_FORCEINLINE K_INLINE
00185 #endif
00186
00187 #define K_WIN_API(t) __declspec(dllimport) t __stdcall
00188
00189
00190 #ifdef KARCH_DEV_GNUC
00191 #define OFN_ENABLEINCLUDENOTIFY 0x00400000 // send include message to callback
00192 #define OFN_ENABLESIZING 0x00800000
00193 #endif
00194
00195
00196
00197 #ifdef KARCH_ARCH_64
00198 #ifdef KARCH_DEV_MSC
00199 typedef __int64 kAtomic;
00200 #else
00201 typedef kLongLong kAtomic;
00202 #endif
00203 #define K_ATOMIC_MIN K_INT64_MIN
00204 #define K_ATOMIC_MAX K_INT64_MAX
00205 #define K_SIZEOF_ATOMIC 8
00206 #define K_ATOMIC_BITS 64
00207
00208 #define kOffset kUInt64
00209 #define K_REFERENCE_MAX K_ULONGLONG_MAX
00210 #else
00211 typedef long kAtomic;
00212 #define K_ATOMIC_MIN K_INT32_MIN
00213 #define K_ATOMIC_MAX K_INT32_MAX
00214 #define K_SIZEOF_ATOMIC 4
00215 #define K_ATOMIC_BITS 32
00216
00217 #define kOffset kUInt32
00218 #define K_REFERENCE_MAX K_ULONG_MAX
00219 #endif
00220
00221
00222
00223 typedef kOffset kSizeT;
00224 typedef kOffset kReference;
00225
00226 #endif // FBXFILESDK_COMPONENTS_KBASELIB_KARCH_TYPES_H
00227