FBX SDK Reference Guide: kaydara.h Source File
Go to the documentation of this file.
00001 
00004 #ifndef _Kaydara_h
00005 #define _Kaydara_h
00006 
00007 /**************************************************************************************
00008 
00009  Copyright  2001 - 2008 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 
00042 
00043 typedef signed char     kByte;        
00044 typedef unsigned char       kUByte;       
00045 
00046 #ifndef FALSE
00047     #define FALSE   0
00048 #endif
00049 #ifndef TRUE
00050     #define TRUE    1
00051 #endif
00052 
00053 #include <float.h>
00054 
00055 typedef bool                kBool;
00056 typedef unsigned char     kBoolean;     
00057 
00058 typedef char                kChar;      
00059 #define K_CHAR(x)           kChar(x)
00060 typedef signed char     kSChar;
00061 #define K_SCHAR(x)          kSChar(x)
00062 typedef unsigned char       kUChar;
00063 #define K_UCHAR(x)          kUChar(x##L)
00064 #define K_CHAR_MIN          K_CHAR(0)
00065 #define K_CHAR_MAX          K_CHAR(127)
00066 #define K_SCHAR_MIN         K_SCHAR(-128)
00067 #define K_SCHAR_MAX         K_SCHAR(127)
00068 #define K_UCHAR_MIN         K_UCHAR(0)
00069 #define K_UCHAR_MAX         K_UCHAR(255)
00070 #define K_SIZEOF_CHAR       sizeof(kChar)
00071 typedef kChar *         kCharPtr;
00072 typedef kChar               kTChar;
00073 typedef kChar *         kTCharPtr;
00074 
00075 #ifndef _T
00076     #define _T(a) a
00077 #endif
00078 
00079 typedef signed short        kShort;
00080 #define K_SHORT(x)          kShort(x)
00081 typedef unsigned short  kUShort;
00082 #define K_USHORT(x)         kUShort(x##U)
00083 #define K_SHORT_MIN         K_SHORT(-32768)
00084 #define K_SHORT_MAX         K_SHORT(32767)
00085 #define K_USHORT_MIN        K_USHORT(0)
00086 #define K_USHORT_MAX        K_USHORT(65535)
00087 #define K_SIZEOF_SHORT      sizeof(kShort)
00088 
00089 typedef signed int      kInt;
00090 #define K_INT(x)            (x)
00091 typedef unsigned int        kUInt;
00092 #define K_UINT(x)           (x##U)
00093 #define K_INT_MIN           K_INT(0x80000000)
00094 #define K_INT_MAX           K_INT(0x7fffffff)
00095 #define K_UINT_MIN          K_UINT(0)
00096 #define K_UINT_MAX          K_UINT(0xffffffff)
00097 #define K_SIZEOF_INT        sizeof(kInt)
00098 
00099 // 32 bit Windows machines AND Intel 64 bit machines
00100 #if defined(_WIN32) || defined(__ia64__) || defined(_M_IA64)
00101     typedef signed int      kLong;
00102     #define K_LONG(x)           (x)
00103     typedef unsigned int        kULong;
00104     #define K_ULONG(x)          (x##U)
00105 #else
00106     typedef signed long     kLong;
00107     #define K_LONG(x)           (x##L)
00108     typedef unsigned long       kULong;
00109     #define K_ULONG(x)          (x##UL)
00110 #endif
00111 #define K_SIZEOF_LONG   sizeof(kLong)
00112 
00113 #if defined(__sgi)
00114     #if (_MIPS_SIM == _ABI64)
00115             #define KLONG_ABI64 1
00116     #endif
00117 #endif    
00118 
00119 #if defined(KLONG_ABI64)
00120     #define K_LONG_MIN          K_LONG(-0x8000000000000000)
00121     #define K_LONG_MAX          K_LONG(0x7fffffffffffffff)
00122     #define K_ULONG_MIN         K_ULONG(0)
00123     #define K_ULONG_MAX         K_ULONG(0xffffffffffffffff)
00124 #else
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 #endif
00130 
00131 #ifdef _MSC_VER
00132     typedef signed __int64      kLongLong;
00133     #define K_LONGLONG(x)       (x##i64)
00134     typedef unsigned __int64    kULongLong;
00135     #define K_ULONGLONG(x)      (x##Ui64)
00136 #else
00137     typedef signed long long    kLongLong;
00138     #define K_LONGLONG(x)       (x##LL)
00139     typedef unsigned long long  kULongLong;
00140     #define K_ULONGLONG(x)      (x##ULL)
00141 #endif
00142 
00143 #define K_LONGLONG_MIN      K_LONGLONG(0x8000000000000000)
00144 #define K_LONGLONG_MAX      K_LONGLONG(0x7fffffffffffffff)
00145 #define K_ULONGLONG_MIN     K_ULONGLONG(0)
00146 #define K_ULONGLONG_MAX     K_ULONGLONG(0xffffffffffffffff)
00147 #define K_SIZEOF_LONGLONG   sizeof(kLongLong)
00148 
00149 typedef float               kFloat;
00150 #define K_FLOAT(x)          (x##F)
00151 #define K_FLOAT_MIN         FLT_MIN 
00152 #define K_FLOAT_MAX         FLT_MAX 
00153 #define K_SIZEOF_FLOAT      sizeof(kFloat)
00154 
00155 typedef double              kDouble;
00156 #define K_DOUBLE(x)         (x)
00157 #define K_DOUBLE_MIN        DBL_MIN 
00158 #define K_DOUBLE_MAX        DBL_MAX 
00159 #define K_SIZEOF_DOUBLE     sizeof(kDouble)
00160 
00161 typedef kSChar              kInt8;
00162 typedef kUChar              kUInt8;
00163 #define K_INT8_MIN          K_SCHAR_MIN
00164 #define K_INT8_MAX          K_SCHAR_MAX
00165 #define K_UINT8_MIN         K_UCHAR_MIN
00166 #define K_UINT8_MAX         K_UCHAR_MAX
00167 #define K_SIZEOF_INT8       sizeof(kInt8)
00168 
00169 typedef kShort              kInt16;
00170 typedef kUShort         kUInt16;
00171 #define K_INT16_MIN         K_SHORT_MIN
00172 #define K_INT16_MAX         K_SHORT_MAX
00173 #define K_UINT16_MIN        K_USHORT_MIN
00174 #define K_UINT16_MAX        K_USHORT_MAX
00175 #define K_SIZEOF_INT16      sizeof(kInt16)
00176 
00177 typedef kInt                kInt32;
00178 typedef kUInt               kUInt32;
00179 #define K_INT32_MIN         K_INT_MIN
00180 #define K_INT32_MAX         K_INT_MAX
00181 #define K_UINT32_MIN        K_UINT_MIN
00182 #define K_UINT32_MAX        K_UINT_MAX
00183 #define K_SIZEOF_INT32      sizeof(kInt32)
00184 
00185 typedef kLongLong           kInt64;
00186 typedef kULongLong          kUInt64;
00187 #define K_INT64_MIN         K_LONGLONG_MIN
00188 #define K_INT64_MAX         K_LONGLONG_MAX
00189 #define K_UINT64_MIN        K_ULONGLONG_MIN
00190 #define K_UINT64_MAX        K_ULONGLONG_MAX
00191 #define K_SIZEOF_INT64      sizeof(kInt64)
00192 
00193 typedef kInt32              kInteger;
00194 typedef kUInt32         kUInteger;
00195 #define K_INTEGER_MIN       K_INT32_MIN
00196 #define K_INTEGER_MAX       K_INT32_MAX
00197 #define K_UINTEGER_MIN      K_UINT32_MIN
00198 #define K_UINTEGER_MAX      K_UINT32_MAX
00199 #define K_SIZEOF_INTEGER    sizeof(kInteger)
00200 
00201 typedef kInt                kEnum;
00202 typedef void *              kPointer;
00203 
00204 #define K_SIZEOF_POINTER    sizeof(kPointer)
00205 #define K_SHIFT_POINTER     (K_SIZEOF_POINTER >> 1)
00206 
00207 #define K_NULL              0
00208 
00209 // 64 bits architectures    
00210 #if defined(__x86_64) || defined(_M_AMD64) || defined(__ia64__) || defined(_M_IA64)
00211     typedef kULongLong  kOffset;
00212 #elif defined(__sgi)
00213     typedef kULong      kOffset;
00214 #else    
00215     typedef kUInt32     kOffset;
00216 #endif    
00217 
00218 #define K_SIZEOF_OFFSET     sizeof(kOffset)
00219 #define K_SHIFT_OFFSET      (K_SIZEOF_OFFSET >> 1)
00220 
00221 
00222 typedef kOffset             kReference;
00223 
00224 typedef enum { K_SUCCESS = 0 , K_ERROR , K_NOTIMPL } kResult;
00225 
00226 #if defined(linux) || defined(__sgi)
00227 
00228         #ifndef strcmpi
00229                 #define strcmpi strcasecmp
00230         #endif
00231         #ifndef stricmp
00232                 #define stricmp strcasecmp
00233         #endif
00234         #ifndef strncmpi
00235                 #define strncmpi strncasecmp
00236         #endif
00237         #ifndef strnicmp
00238                 #define strnicmp strncasecmp
00239         #endif
00240 #endif
00241 
00242 // Deprecated macro, to remind people to stop using certain functions
00243 
00244 #if defined(__GNUG__)       // GNU compiler
00245     #define K_DEPRECATED __attribute__((deprecated))
00246 #elif defined(__INTEL_COMPILER) // Intel compiler
00247     #if (__INTEL_COMPILER >= 810) // Maybe we could use an earlier version, we should check this some day
00248         #define K_DEPRECATED __declspec(deprecated)
00249     #else
00250         #define K_DEPRECATED
00251     #endif
00252 #elif defined(_MSC_VER)    // Microsoft compiler
00253     #if (_MSC_VER >= 1300) // 7.1
00254         #define K_DEPRECATED __declspec(deprecated)
00255     #else
00256         #define K_DEPRECATED
00257     #endif
00258 #elif defined(__sgi)      // SGI compiler
00259     #define K_DEPRECATED
00260 #elif defined(__MWERKS__) // Metrowerks compiler
00261     #define K_DEPRECATED
00262 #else // Unknown compiler
00263     #define K_DEPRECATED
00264 #endif
00265 
00266 
00267 // Compiler specific
00268 #ifdef _MSC_VER
00269     #pragma warning(disable: 4514) //unreferenced inline function has been removed (Level 4) optimizer  
00270     #pragma warning(disable: 4100) // warning C4100: '?' : unreferenced formal parameter
00271     #pragma warning(disable: 4710) // function not inlined
00272     
00273     /*For 4251:
00274     In fact, the documentation explicitly states this in the page titled "Using dllimport and dllexport in C++ Classes" :
00275     As a rule, everything that is accessible to the DLL's client (according to C++ access rules) should be part of the exportable interface. This includes private data members referenced in inline functions
00276     This is the problem. If you have a template SomeTemplate<T>, it is not marked with dllexport because you can only export definitions, not declarations, and a template is not a definition.
00277     */
00278     #pragma warning( disable : 4251 )
00279 #endif
00280 
00281 #define K_FORWARD( ClassName ) class ClassName; typedef ClassName *H##ClassName;
00282 
00283 #endif // #ifndef _Kaydara_h
00284 
00285 
00286 
00287