00001
00002
00003
00004
00005
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 #ifndef __ftypes__
00037 #define __ftypes__
00038
00039 #include "fplatform.h"
00040
00041 #if MAC
00042 #undef UNICODE
00043 #define UNICODE 0
00044 #endif
00045
00046
00047 namespace Steinberg
00048 {
00049
00050
00051 typedef char int8;
00052 typedef unsigned char uint8;
00053 typedef unsigned char uchar;
00054
00055 typedef short int16;
00056 typedef unsigned short uint16;
00057
00058 #if MAC && __LP64__
00059 typedef int int32;
00060 typedef unsigned int uint32;
00061 #else
00062 typedef long int32;
00063 typedef unsigned long uint32;
00064 #endif
00065
00066 static const int32 kMaxLong = 0x7fffffff;
00067 static const int32 kMinLong = (-0x7fffffff - 1);
00068
00069 #if WINDOWS
00070 typedef __int64 int64;
00071 typedef unsigned __int64 uint64;
00072 static const int64 kMaxInt64 = 9223372036854775807i64;
00073 static const int64 kMinInt64 = (-9223372036854775807i64 - 1);
00074 #else
00075 typedef long long int64;
00076 typedef unsigned long long uint64;
00077 static const int64 kMaxInt64 = 0x7fffffffffffffffLL;
00078 static const int64 kMinInt64 = (-0x7fffffffffffffffLL-1);
00079 #endif
00080
00081
00082
00083 typedef int64 TSize;
00084 typedef int32 tresult;
00085
00086 static const float kMaxFloat = 3.40282346638528860e+38;
00087
00088 #if PLATFORM_64
00089 typedef uint64 TPtrInt;
00090 #else
00091 typedef uint32 TPtrInt;
00092 #endif
00093
00094
00095
00096 typedef uint8 TBool;
00097 #if MOTIF
00098 #ifdef NOBOOL
00099 typedef uint8 bool;
00100 static const bool false = 0;
00101 static const bool true = 1;
00102 #endif
00103 #endif
00104
00105
00106
00107 #if _MSC_VER
00108 typedef __wchar_t char16;
00109 #else
00110 typedef int16 char16;
00111 #endif
00112
00113 #if UNICODE
00114 typedef char16 tchar;
00115 #else
00116 typedef char tchar;
00117 #endif
00118
00119 typedef char char8;
00120 typedef const char* FIDString;
00121 }
00122
00123
00124
00125 #define SWAP_32(l) { \
00126 unsigned char* p = (unsigned char*)& (l); \
00127 unsigned char t; \
00128 t = p[0]; p[0] = p[3]; p[3] = t; t = p[1]; p[1] = p[2]; p[2] = t; }
00129
00130 #define SWAP_16(w) { \
00131 unsigned char* p = (unsigned char*)& (w); \
00132 unsigned char t; \
00133 t = p[0]; p[0] = p[1]; p[1] = t; }
00134
00135 #define SWAP_64(i) { \
00136 unsigned char* p = (unsigned char*)& (i); \
00137 unsigned char t; \
00138 t = p[0]; p[0] = p[7]; p[7] = t; t = p[1]; p[1] = p[6]; p[6] = t; \
00139 t = p[2]; p[2] = p[5]; p[5] = t; t = p[3]; p[3] = p[4]; p[4] = t;}
00140
00141 #endif