MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lt_types.h
Go to the documentation of this file.
00001 /* $Id$ */
00002 /* //////////////////////////////////////////////////////////////////////////
00003 //                                                                         //
00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
00005 // Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
00006 // prohibited.  Access to and use of this code is permitted only under     //
00007 // license from LizardTech, Inc.  Portions of the code are protected by    //
00008 // US and foreign patents and other filings. All Rights Reserved.          //
00009 //                                                                         //
00011 /* PUBLIC */
00012 
00022 #ifndef LT_TYPES_H
00023 #define LT_TYPES_H
00024 
00025 #include <limits.h>
00026 #include <float.h>
00027 
00028 #include "lt_platform.h"
00029 
00030 
00031 #if defined(LT_COMPILER_MS)
00032    #pragma warning(push,4) 
00033 #endif
00034 
00044 typedef signed char     lt_int8;
00046 typedef unsigned char   lt_uint8;
00048 typedef signed short    lt_int16;
00050 typedef unsigned short  lt_uint16;
00052 typedef signed int      lt_int32;
00054 typedef unsigned int    lt_uint32;
00056 typedef float           lt_float32;
00058 typedef double          lt_float64;
00059 
00060 #if defined(LT_COMPILER_MS)
00061 
00062    typedef signed __int64     lt_int64;
00064    typedef unsigned __int64   lt_uint64;
00065 #elif defined ( LT_COMPILER_GNU ) || \
00066       defined ( LT_COMPILER_SUN )
00067 
00068    typedef long long int              lt_int64;
00070    typedef unsigned long long int     lt_uint64;
00071 #else
00072    #error NOT YET PORTED TO TARGET COMPILER
00073 #endif
00074 
00077 #ifndef DOXYGEN_EXCLUDE
00078 
00079 #define LT_CHAR_MAX ((char)CHAR_MAX) 
00080 #define LT_CHAR_MIN ((char)CHAR_MIN) 
00081 #define LT_SCHAR_MAX ((signed char)SCHAR_MAX) 
00082 #define LT_SCHAR_MIN ((signed char)SCHAR_MIN) 
00083 #define LT_UCHAR_MAX ((unsigned char)UCHAR_MAX) 
00084 
00085 #define LT_SHRT_MAX ((short int)SHRT_MAX) 
00086 #define LT_SHRT_MIN ((short int)SHRT_MIN) 
00087 #define LT_USHRT_MAX ((unsigned short int)USHRT_MAX) 
00088 
00089 #define LT_INT_MAX ((int)INT_MAX) 
00090 #define LT_INT_MIN ((int)INT_MIN) 
00091 #define LT_UINT_MAX ((unsigned int)UINT_MAX) 
00092 
00093 #define LT_LONG_MAX ((long int)LONG_MAX) 
00094 #define LT_LONG_MIN ((long int)LONG_MIN) 
00095 #define LT_ULONG_MAX ((unsigned long int)ULONG_MAX) 
00096 
00097 #define LT_FLT_MIN ((float)FLT_MIN)
00098 #define LT_FLT_MAX ((float)FLT_MAX)
00099 #define LT_FLOAT_MIN (LT_FLT_MIN)
00100 #define LT_FLOAT_MAX (LT_FLT_MAX)
00101 
00102 #define LT_DBL_MIN ((double)DBL_MIN)
00103 #define LT_DBL_MAX ((double)DBL_MAX)
00104 #define LT_DOUBLE_MIN (LT_DBL_MIN)
00105 #define LT_DOUBLE_MAX (LT_DBL_MAX)
00106 
00107 #define LT_INT8_MAX      ((lt_int8)127)                     /*  2^7 - 1  */
00108 #define LT_INT8_MIN      ((lt_int8)(-LT_INT8_MAX - 1))      /*  -2^7     */
00109 #define LT_UINT8_MAX     ((lt_uint8)255U)                   /*  2^8 - 1  */
00110 #define LT_UINT8_MIN     (0)
00111 #define LT_INT16_MAX     ((lt_int16)32767)                  /*  2^15 - 1 */
00112 #define LT_INT16_MIN     ((lt_int16)-LT_INT16_MAX - 1)      /*  -2^15    */
00113 #define LT_UINT16_MAX    ((lt_uint16)65535U)                /*  2^16 - 1 */
00114 #define LT_UINT16_MIN    (0)
00115 #define LT_INT32_MAX     ((lt_int32)2147483647)             /* 2^31 - 1 */
00116 #define LT_INT32_MIN     ((lt_int32)(-LT_INT32_MAX - 1))    /* -2^31    */
00117 #define LT_UINT32_MAX    ((lt_uint32)4294967295U)           /* 2^32 - 1 */
00118 #define LT_UINT32_MIN    (0)
00119 #define LT_INT64_MIN     ((lt_int64)-LT_INT64_MAX - 1)      /* -2^63    */
00120 #define LT_UINT64_MIN    (0)
00121 
00122 // GNU wants these constants suffixed, windows does not
00123 #if defined(LT_COMPILER_GNU) || \
00124     defined(LT_COMPILER_SUN)
00125    #define LT_INT64_MAX     ((lt_int64)9223372036854775807LL)    /* 2^63 - 1 */
00126    #define LT_UINT64_MAX    ((lt_uint64)18446744073709551615ULL)  /* 2^64 - 1 */
00127 #elif defined(LT_COMPILER_MS)
00128    #define LT_INT64_MAX     ((lt_int64)9223372036854775807)    /* 2^63 - 1 */
00129    #define LT_UINT64_MAX    ((lt_uint64)18446744073709551615)  /* 2^64 - 1 */
00130 #else
00131    #error NOT YET PORTED TO TARGET COMPILER
00132 #endif
00133 
00134 #endif /* DOXYGEN_EXCLUDE */
00135 
00136 
00138 //typedef char lt_utf8;
00139 //#define LT_UTF8STR(str) ((lt_utf8 *)(str))
00140 
00145 typedef char      lt_ascii;
00146 typedef lt_uint8   lt_utf8;
00147 //typedef char   lt_utf8;
00148 typedef lt_uint16   lt_utf16;
00149 typedef lt_uint32   lt_utf32;
00151 
00152 
00153 #if defined(LT_COMPILER_MS)
00154    #pragma warning(pop) 
00155 #endif
00156 
00157 #endif /* LT_TYPES_H */