$search
00001 00008 /***************************************************************************** 00009 ** Ifdefs 00010 *****************************************************************************/ 00011 00012 #ifndef ECL_PORTABLE_TYPES_HPP_ 00013 #define ECL_PORTABLE_TYPES_HPP_ 00014 00015 /***************************************************************************** 00016 ** Includes 00017 *****************************************************************************/ 00018 00019 #include "ecl.hpp" 00020 #include <limits> 00021 00022 /***************************************************************************** 00023 ** Namespaces 00024 *****************************************************************************/ 00025 00026 namespace ecl { 00027 00028 /***************************************************************************** 00029 ** Integers 00030 *****************************************************************************/ 00031 // If errors show up, need to check the ecl macro logic. 00032 #if ECL_SIZE_OF_CHAR == 1 00033 typedef char int8; 00034 typedef unsigned char uint8; 00035 #else 00036 #error "ecl::int8 could not be typedef'd (probably faulty ecl logic)." 00037 #endif 00038 00039 #if ECL_SIZE_OF_SHORT == 2 00040 typedef short int16; 00041 typedef unsigned short uint16; 00042 #else 00043 #error "ecl::int16 could not be typedef'd (probably faulty ecl logic)." 00044 #endif 00045 00046 #if ECL_SIZE_OF_INT == 4 00047 typedef int int32; 00048 typedef unsigned int uint32; 00049 #else 00050 #error "ecl::int32 could not be typedef'd (probably faulty ecl logic)." 00051 #endif 00052 00053 #if ECL_SIZE_OF_LONG == 4 00054 typedef long long int64; 00055 typedef unsigned long long uint64; 00056 #elif ECL_SIZE_OF_LONG == 8 00057 typedef long int64; 00058 typedef unsigned long uint64; 00059 #else 00060 #error "ecl::int64 could not be typedef'd (probably faulty ecl logic)." 00061 #endif 00062 00063 /***************************************************************************** 00064 ** Floats 00065 *****************************************************************************/ 00066 00067 #if ECL_SIZE_OF_FLOAT == 4 00068 typedef float float32; 00069 #else 00070 #error "ecl::float32 could not be typedef'd (probably faulty ecl logic)." 00071 #endif 00072 #if ECL_SIZE_OF_DOUBLE == 8 00073 typedef double float64; 00074 #else 00075 #error "ecl::float64 could not be typedef'd (probably faulty ecl logic)." 00076 #endif 00077 #if ECL_SIZE_OF_LONG_DOUBLE == 12 00078 typedef long double float96; 00079 #elif ECL_SIZE_OF_LONG_DOUBLE == 16 00080 typedef long double float128; 00081 #else 00082 #error "ecl::float96 could not be typedef'd (probably faulty ecl logic)." 00083 #endif 00084 00085 } // namespace ecl 00086 00087 #endif /* ECL_PORTABLE_TYPES_HPP_ */